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.

re-usable snippet (but evidently not a global user var or a 'snippet')

March 28, 2012 10:11am

Subscribe [2]
  • #1 / Mar 28, 2012 10:11am

    dagnew

    5 posts

    I’m an EE newbie whose experience is largely with (fairly simple) PHP sites. Sometimes I have some text that needs to be in 2 or more places on the site. For DRY reasons, I’d like to enter that text just once. But this repeating text is to appear in a static page (or possibly within a channel entry), not in a template. I have figured out how to do includes in EE, but that only works within a template. AFAIK this is true of global user variables and snippets as well.

    Am I missing something?

  • #2 / Mar 28, 2012 10:25am

    dagnew

    5 posts

    Umm… I just read this comment which states,

    I often use a “miscellaneous content” channel for little bits of text that need to be client-editable.  This content can still be called using code stored in a snippet for a DRY build approach.

    But I’m unclear if this applies to my situation, or… how I would implement that suggestion.

  • #3 / Mar 29, 2012 12:45pm

    Shane Eckert

    7174 posts

    Hello dagnew,

    Newbies are welcome here! Glad to have you as a part of the community.

    When you say that you have a static page, can you tell me a little about that? Do you mean a template that will have only static code in it, so no ExpressionEngine tags?

    Have you read through using snippets yet?

    I hope this helps, please let me know if I can be of more help.

    Cheers,

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

ExpressionEngine News!

#eecms, #events, #releases