ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

How to use a template on a single page?

January 16, 2012 8:22am

Subscribe [3]
  • #1 / Jan 16, 2012 8:22am

    JamesBrighton

    146 posts

    I have a channel which is used for a number of pieces of content. One of those pieces needs a contact form (im using freeform). Currently what ive done is add the freeform tags straight into the piece of content.

    Im having an issue with the email field not being included in the notify template. According to the freeform support the freeform tags should be added to a template, not into a piece of content.

    Whats the best way to add the freeform tags to a template but only for one page? I could add it to the channel’s template with some conditional PHP that only showed it if it had the url of the page. However I was wondering if there is a cleaner solution?

    Thanks

  • #2 / Jan 16, 2012 9:20am

    Boyink!

    5011 posts

  • #3 / Jan 17, 2012 7:27pm

    Sean C. Smith

    3818 posts

    Hi James,

    What I would typically do here for a template that needs special content for only one page is do a conditional check based on the url like so:

    {if segment_3 =="foobar"}
      some content here
    {/if}

    You can change segment_3 to segment_2 or whatever url segment you need to check for.

    Of course Mikes solution would work as well.

    Does that help you out?

    Sean.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases