Jump to content

Search and replace with includes


YorkshireSteve

Recommended Posts

Hi All,

I'm creating a basic template system for a website and have variables in the content such as [!--fonto:Courier New--][span style=\"font-family:Courier New\"][!--/fonto--]{{Content:Body}}[!--fontc--][/span][!--/fontc--] which would be replaced with the variable [!--fonto:Courier New--][span style=\"font-family:Courier New\"][!--/fonto--]$content['body'][!--fontc--][/span][!--/fontc--]. This works fine, however, I also want to replace [!--fonto:Courier New--][span style=\"font-family:Courier New\"][!--/fonto--]{{Component:Login_Form}}[!--fontc--][/span][!--/fontc--] with the file [!--fonto:Courier New--][span style=\"font-family:Courier New\"][!--/fonto--]Components/Login_Form.php[!--fontc--][/span][!--/fontc--]. I'm not having much luck with this but it's something which would be very handy not only on this project, but also on other projects in the future.

Does anyone have any ideas how this may be achieved?

Thanks,

Steve
Link to comment
Share on other sites

[!--quoteo(post=362197:date=Apr 6 2006, 01:38 PM:name=obsidian)--][div class=\'quotetop\']QUOTE(obsidian @ Apr 6 2006, 01:38 PM) [snapback]362197[/snapback][/div][div class=\'quotemain\'][!--quotec--]
as long as your Login_Form component is simply an HTML form, you could use file_get_contents() to assign the content of the component to a variable and echo it out inside the template tag.
[/quote]
Thanks for the reply. Anything represented by [!--fonto:Courier New--][span style=\"font-family:Courier New\"][!--/fonto--]{{Content:xxxx}}[!--fontc--][/span][!--/fontc--] is HTML code, pulled straight from a database. Anything in the form of [!--fonto:Courier New--][span style=\"font-family:Courier New\"][!--/fonto--]{{Component:xxxx}}[!--fontc--][/span][!--/fontc--] will need to be included as this is going to be executable code (such as a poll, form (including processing) etc.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.