Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How can I include text in GS?
#1
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
Reply
#2
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.
Reply
#3
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.
Reply
#4
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.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#5
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?
Reply
#6
Worked for me as well. Thank you, my question was asked and answered before I asked it!
Reply
#7
Sorry for my delay...

All work fine now.

Thankyou for your ideas.

Have a nice day.

Luke
Reply




Users browsing this thread: 1 Guest(s)