Posts: 29
Threads: 9
Joined: Dec 2010
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
Posts: 524
Threads: 48
Joined: Mar 2011
2011-06-06, 02:15:25
(This post was last modified: 2011-06-06, 02:33:27 by infos.media.)
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.
Posts: 29
Threads: 9
Joined: Dec 2010
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.
Posts: 2,094
Threads: 54
Joined: Jan 2011
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.
Posts: 524
Threads: 48
Joined: Mar 2011
2011-06-06, 03:48:40
(This post was last modified: 2011-06-06, 03:50:04 by infos.media.)
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?
Posts: 1
Threads: 0
Joined: Jun 2011
Worked for me as well. Thank you, my question was asked and answered before I asked it!
Posts: 29
Threads: 9
Joined: Dec 2010
Sorry for my delay...
All work fine now.
Thankyou for your ideas.
Have a nice day.
Luke