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.

[Solved] Single Tag Question {!-- An easy one... --}

August 31, 2012 5:06am

Subscribe [2]
  • #1 / Aug 31, 2012 5:06am

    jazmel

    2 posts

    Most guides I see quickly skip over the single tag option.

    In most cases I want just the title tag off a web blog. And it seems crazy to disable all my other fields for efficiency or load up all my entries to then take the first one’s title.

    Is there a way I can get the title via a single tag?

    Thanks,

    (ExpressionEngine 1.6.9)

  • #2 / Aug 31, 2012 7:00am

    Boyink!

    5011 posts

    Can you skip over what doesn’t exist? 😉

    There is no native single-tag to return titles for an entry. Seems like I’ve seen custom plugins to do this.

    Otherwise if you are on a single entry page you can usually nest the entire page in one loop, re-using the title variable where needed.  There is also a limit parameter, or if EE sees an entry id or url_title in the url it will only retrieve that entry (vs. getting all of them and then only use the first).

  • #3 / Aug 31, 2012 7:34am

    jazmel

    2 posts

    Can you skip over what doesn’t exist? 😉

    There is no native single-tag to return titles for an entry. Seems like I’ve seen custom plugins to do this.

    Otherwise if you are on a single entry page you can usually nest the entire page in one loop, re-using the title variable where needed.  There is also a limit parameter, or if EE sees an entry id or url_title in the url it will only retrieve that entry (vs. getting all of them and then only use the first).

    Haha, Thanks.

    I was tempted to nest the entire page in one loop, but was not sure keeping the loop open for that length of time was wise. In truth I am unsure of best pratices with EE/Code Igniter. I usually try and keep to the snap-shut approach in regard to database requests - Get in quick, store and get out quicker.

    Yep I am using the limit=1 and entry_id in come cases. Am I best to use disable=“field 1|field 2…”?

    Thanks for your reply,

  • #4 / Aug 31, 2012 7:42am

    Boyink!

    5011 posts

    I’m not big on the phrase “best practices” - but that’s another post altogether. Use the output profiler and template debugger to experiment to find the best approach to your design on your server.

    You can’t disable individual fields.  You can disable “custom_fields” (of which title isn’t one).  Check the docs there for all the things you can disable on a weblog:entries tag.

  • #5 / Aug 31, 2012 8:01am

    jazmel

    2 posts

    Yes, that is what provoked me to ask about the single tag and where I did see “The disable= parameter allows you to turn off aspects of the tag that you might not be using in order to improve performance.”

    Thanks, I suppose that does answer my original post.

  • #6 / Aug 31, 2012 2:08pm

    Shane Eckert

    7174 posts

    Hey jazmel,

    Awesome! Glad to see that Mike was able to help!

    If you need anything else, please just let me know by opening a new thread.

    Cheers,

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

ExpressionEngine News!

#eecms, #events, #releases