Forum Moderators: coopster
Would it be possible to designate a page's 'stripped content' as a variable, and call a (say, three column) template containing that variable -or in other words, have a page's content written into a called template - on the same page?
Thanks for any help in this.
another thought would be to move all code that comes before your content into one file and all code that comes after into another.
then just run through your pages, cut the top off and add an include for your header file, then cut off the bottom and add an include for your footer.
The header-footer thing is easy as pie for sure, but what makes things complicated is a 'floating three-column' layout present in the 'body' of many pages - the 'stripped' former-html content will be going into the centre <div>, but the outer columns will be menus and ads.
I did find one solution - wrapping the 'stripped html' content block of code into a 'content()' function - then echo(ing) content() in the 'target <div>' in the template. This seems to work - Perhaps I've come up with an original something, but in my inexperience am not sure if it is commonplace or not. If there is a better solution out there ('same-page' inclusion into a called-for-inclusion-within-the-same-page-template), please let me know!
PS: is there any way of transforming a block of html code into a variable instead of a function? In your reply it sounds as if this is so... thanks!
you could probably use Heredoc [php.net]
>> wrapping the 'stripped html' content block of code into a 'content()' function
that method is fairly common