Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SOLVED How to insert page into page
#1
I am just started to use GetSimple and really love it! BTW

my question is: how I can insert content of one page into another page in WYSIWYG editor? So let say I have Page1 with some general (constant html rich info) and want to insert its content into other page (or even pages). so I want to reuse it in different pages without typing it again and again (the same info).

Is it possible? how? Huh
Reply
#2
- Install and activate DynPages plugin.
- Create a component named e.g. pagecontent with this:
PHP Code:
<?php
  
global $args;  
  
getPageContent($args[0]);
?>

Insert this in your page(s) content wherever you want to insert another page's content:
Code:
{% pagecontent pageid %}
where pageid to the slug/page id of the page you want to insert.)

It's a quickie. It could be improved so that it checks if the slug exists, so that you don't get errors if it doesn't.
Reply
#3
Without a plugin you can insert html into your page as
  • html written directly into the template
  • page content (as many as you want inserted into an actual page)
  • components, as many as you want.
You can put a component inside a component but you can't put a component or page content inside other page content although you can have as many blocks of page content as you want.

there are plugins which will help you with different blocks of editable content as well, like the Simple Input Tabs plugin.
Reply
#4
wow, Carlos, that was it! Works as I need! Thank you very much!!

Timbow, sorry, but it seems that I don't really understand your idea...
Reply
#5
You're welcome.

There's (at least) one catch with this (unless you disable paragraphs in ckeditor): if users are not careful you may end up with some nested paragraphs (<p><p>...</p></p>)
Reply
#6
Carlos, thank you, I will take care about it!
Reply
#7
Information 
See http://get-simple.info/wiki/themes:template_tags
Code:
<?php getPageContent('slug'); ?>

You can then put that somewhere in a template file and use the template file on a page where you need that page content.
Reply




Users browsing this thread: 2 Guest(s)