GetSimple Support Forum

Full Version: How can I include text in GS?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Good morning to all.

I need an idea to solve a problem.

How can I insert a external text file (ie source.txt) in a page created with GS?

I generally use the "include" PHP function but here does not work.

How can I do?

Thanks
Hi Bak,

execution of PHP is restricted in pages, but you can use a plugin to make it work:

I recommend the DynPages plugin, because you can use it like a component: You put your PHP into a normal GetSimple component and call it via DynPages then. A cool feature is that you can even pass parametres to the component so you could code a general 'include text PHP script' and pass the text file name/path to it. Makes it reusable.

Usage info can be found on the plugin's page. If you have more questions, feel free to ask.
Hi polyfragmented,

good idea but there is a problem.

If I create 2 components and I inserted this 2 component in the same page (one at the beginning of the page ad the 2nd at the end of the page) only one is displayed. Why?

Thankyou in advance.
Bak Wrote:If I create 2 components and I inserted this 2 component in the same page (one at the beginning of the page ad the 2nd at the end of the page) only one is displayed. Why?

Just tested it (two times the same component with different arguments plus another component on one page) - works for me!
Maybe you have a blank between { and % or you use the wrong name - see components page, gray code example for correct name.
Bak Wrote:If I create 2 components and I inserted this 2 component in the same page (one at the beginning of the page ad the 2nd at the end of the page) only one is displayed. Why?
No idea since we don't know how your actual inclusion of the components looks. Can you give us a bit more info or show your template/code/components?
Worked for me as well. Thank you, my question was asked and answered before I asked it!
Sorry for my delay...

All work fine now.

Thankyou for your ideas.

Have a nice day.

Luke