PhP or Virtual includes...
10 posts by 4 authors in: Forums > CMS Builder
Last Post: March 25, 2019 (RSS)
By osga - March 20, 2019
Hello...
We a re tyring to use either the... <!--#include virtual="page.html" --> or <?php include 'page.html';?> ...in the bodies of articles, but CMSB, seems to ignore them. Any hints?
By gkornbluth - March 20, 2019
Hi,
What do you mean by "CMSB ignores them".
I've been using the format <?php include ("page.php"); ?> and it works for me, but I think that it should work for including html pages as well.
Just a guess, but if there's PHP code that needs to be executed in the included copy, I think the included page may have to end in .php (not sure).
Hope that helps,
Jerry Kornbluth
Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php
By daniel - March 20, 2019
Hi osga,
Are you placing the include statements within PHP files, or are you adding them to content fields in the CMS? PHP functionality (such as include statements) won't parse from within content fields.
Technical Lead
interactivetools.com
By osga - March 21, 2019
We were trying to use them in the Content Field of an article in cms, but since neither way will parse, we will do something else...
Thanks Guys...
By Toledoh - March 21, 2019
I quite often use a check-box or similar in the CMS that I then use to display an include if selected. Does that help?
Tim (toledoh.com.au)
By gkornbluth - March 21, 2019
It would be helpful if you posted a sample of the code you're trying to use including the context of where you're using it.
Best,
Jerry Kornbluth
Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php
By osga - March 25, 2019
We were trying to use the codes included in the first post I created
<!--#include virtual="page.html" --> or <?php include 'page.html';?>
I even tried the one suggested <?php include ('page.html');?>
but none of it has worked.
By gkornbluth - March 25, 2019 - edited: March 25, 2019
Some actual trial page code would still be helpful
It's hard to tell what's going on from a few snippets
Thanks,
Jerry Kornbluth
Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php
By daniel - March 25, 2019
Hey Jerry,
I believe that they are just attempting to add the includes within CMSB content fields (which isn't supported), so there wouldn't really be any other code to show.
Cheers,
Technical Lead
interactivetools.com
By gkornbluth - March 25, 2019
Hey Daniel,
I thought the same, but wanted to be sure and maybe offer an alternative.
Jerry
Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php