EE: Title plugin

This ExpressionEngine plugin lets you retrieve an entry title quickly and effectively. This post now provides a place for support for the Low Title plugin.

Download and docs for Low Title can be found in the Software section

August 6th 2007 | Add-Ons, ExpressionEngine | 31 comments

Comments

  1. 1 JMB February 21st 2008, 01:12

    Will this plugin allow one to enter static <title> tags? I mean, if I have an About Us page I want the title to be very custom for SEO purposes. ie: <title>New York Travel, Vacation in NY, Attend a Broadway Show</title>.

  2. 2 Low February 21st 2008, 01:29

    JMB, this plugin will fetch 1 field from the database, from an entry, category, weblog or site. It will not add any html-tags, including <title> tags.

    You could add a custom field like ‘SEO title’ to your weblog and use that as the page <title>. But if you’re after titles for static pages, why not just hard code them in the templates? Example:

    <title>{if segment_1 == "about-us"}New York Travel, Vacation in NY, Attend a Broadway Show{/if}</title></pre>

  3. 3 Jonas Hodge April 15th 2008, 03:17

    Hi Low,

    This looks great. I’m assuming the biggest advantage of this would be to cut down on the resources used to get the same info via weblog:entries. Is that correct?

  4. 4 Low April 15th 2008, 09:03

    That’s correct, Jonas. Plus, it’s a lot less to type in.

  5. 5 Richard Bird May 29th 2008, 15:36

    Just realized that this won’t work…

    {exp:title:category url_title='{segment_4}' custom_field="category_description"}

    …because “category_description” is a default field for categories, not a custom field. So, it seems that to do what I really wanted, I would need to create a custom category field and duplicate the information already contained in my category_description field. No?

  6. 6 Low May 30th 2008, 09:24

    You’re absolutely right, Richard. That should be the way to go.

  7. 7 Matt Crest June 18th 2008, 23:42

    I’m new to EE, and found this plugin to be quite promising. One issue though, I’m having difficulty getting the plugin to use the category and/or entry specific to the page that is loaded.
    Here’s my code:

    <title>
    {exp:title:entry} | {exp:title:category} | {exp:title:site}
    </title>
    </pre>

    What I would like to happen is that the title attribute will be rendered as the unique entry title, then the category the title is in, and finally the site name.
    Entry Title First | Category Second | Site Name Last

    With my current code, I’m getting the same title for the home page as my one other existing page.

    Any thoughts on what I am doing wrong? Thanks.

  8. 8 Low June 19th 2008, 00:08

    Hi Matt. You have to tell the plugin which title to fetch. It doesn’t do that automatically, so you’ll probably have to use some kind of url structure to get the information you need.

    A typical EE url can look like this: domain.com/index.php/blog/comments/my-first-post where blog is your template group, comments is your template, and my-first-post is the url_title for a post. With this, you could use {exp:title:entry url_title="{segment_3}"} to get the title for the blog post.

    Instead of {exp:title:site} (which is only really useful if you’re using the MSM), you might as well use the global variable {site_name}. That’ll save you one query.

    Getting the right category title, however, requires a bit more thought. You might want to add the category to your url structure, like this: domain.com/index.php/blog/comments/category/news/my-first-post, then you could use {exp:title:entry url_title="{segment_5}"} | {exp:title:category url_title="{segment_4}"}. You could also use a different approach and use the rEEposition plugin to construct your title…

  9. 9 Matt Crest June 19th 2008, 00:42

    Thanks Low. That helps a lot. I’ll do some experimenting and see what I can do.

  10. 10 Stanislav Majerski June 30th 2008, 11:25

    Hi Low,

    Thanks for keeping this pluging updated and adding features. I am trying to use it on a multilingual website using Mark Huots language switcher but I am not sure how should the custom_field=”title_{language}”} work.

    I turned on the show_error to see what’s wrong and it gives me “Custom field not found”. Is {language} a global EE variable. Seems not. And I don’t see it in the plugin being called. Anyway…

    I tried to retrieve it with the cookie plugin: custom_field=”title{exp:cookie:retrieve name=”lang”}” no luck, seems like the order of parsing those values is a mismatch.

    I just baffled how you use the custom_filed with the {language} in your plugin.

    Thank you very much

  11. 11 Low June 30th 2008, 11:44

    Hi Stanislav. In my example {language} is a global variable, set in (for example) your path.php file. I’m not familiar with Mark’s language switcher, and an EE-tag as a parameter value will not work… You should somehow try and set the global variable, so you can use it as input for this plugin.

  12. 12 Stanislav Majerski June 30th 2008, 12:11

    Oh I see, OK. I understand. Will try, thank you.

  13. 13 Jörn November 21st 2008, 02:07

    Hi,
    nice Plugin! Does it work with the Forum-Module also?
    Thanks,
    Jörn

  14. 14 Low November 21st 2008, 10:36

    @Jörn, like all plugins, this only works in the regular EE templates.

  15. 15 Ryan J. Bonnell November 26th 2008, 18:21

    Does this plugin work with the Pages module in ExpressionEngine?

    I’m getting inconsistent results displaying the title of an Entry when used to create a “static” page with a URL like /about/staff/.

    When I compare the following code samples they don’t result in the same output (though I believe they should):

    {exp:title:entry weblog="default_site"} vs. {exp:weblog:entries weblog="default_site"}{title}{/exp:weblog:entries}

    From what I can determine, this plugin works only for “static” page titles in {segment_1} but not titles contained in {segment_2} and beyond.

  16. 16 Low November 26th 2008, 18:33

    Hi Ryan. This plugin isn’t dynamic. It’ll always need either an entry_id or url_title to get the right title.

  17. 17 Tim Kelty July 28th 2009, 18:02

    It would be great if this plugin could output the entries page_uri/page_url as well. Might dig in and see what would be involved.

  18. 18 Tim Kelty October 28th 2009, 23:12

    To anyone interested, I added the ability to use: {exp:title page_uri=”/about”} or {exp:title page_uri=”{segment_2}”} for the Pages module (or Structure).

    Low - If you want to add it to GitHub I can fork it.

  19. 19 Low October 29th 2009, 11:12

    Tim, could you send me your version, please? I’ll see if I can integrate it into mine.

  20. 20 Tim Kelty November 19th 2009, 19:48

    Another idea!
    It would be nice to have an option to fall back to the title field if the custom field you specify is empty.

  21. 21 Stephen McIver December 11th 2009, 19:00

    Hi Low, thanks for this plugin, i’ve just starting using/testing it with my first EE2 PB install.

    Just wondering if it’s possible for it to pull in the ‘last segment’ at all?

    I’d love a title like this: <title>Site Label - Last Segment</title>

    Thanks,

    Stephen

  22. 22 Mrs. Flinger December 17th 2009, 23:58

    Let this be a lesson to me: ALWAYS check for a plugin from Low before I go all custom coding shit all the time. :: facepalm ::

    Lovely, Low. Now, kick me in the ass for re-inventing the wheel.

  23. 23 Joost January 17th 2010, 15:30

    Is is possible to use variables other than {segment_2},{segment_3}, etc. in “url_title=”{segment_3}”? With a query I pulled a url_title as {r_url_title} but url_title=”{r_url_title}” ends up in a syntax error.

  24. 24 Low January 17th 2010, 17:14

    Joost, it should be possible. What’s the error you’re getting? Also, if you’re already using a query to get the url_title, why not get the title itself while you’re at it?

  25. 25 Joost January 17th 2010, 23:34

    My purpose was to create navigational links (one level deeper from where I was) so I wasn’t on the page itself. I did find another solution to get this work with bypassing the use of the query module and the title plugin. Thanks anyway!

  26. 26 jf January 26th 2010, 17:57

    Downloaded the zip, it contains 2.0 version, do you have the 1x version available anywhere, plugin seems perfect for my needs. thanks!

  27. 27 Low January 26th 2010, 18:03

    jf, there are 2 download links on the software page. The top one contains version 1.1, compatible with EE 1.x.

  28. 28 jf January 26th 2010, 18:08

    :) Oh I see, I had both version in my download folder and kept opening the 2.0 version. I guess it’s time to take a break.

  29. 29 Sam Oltz May 21st 2010, 23:15

    Really like your plugin, needed MultiSite Manage support. Putting it in was super simple. You can checkout my modified version here: http://www.samoltz.com/drop/pi.title.php.zip

  30. 30 Stephen McIver June 21st 2010, 03:42

    Hi Low,

    Further to my request for a ‘last segment’ parameter above, I’ve just managed to get this working in conjunction with the Last Segment addon by Bjorn Borresen.

    {exp:low_title:entry url_title=”{segment_{last_segment_id}}”} - {last_segment_id}

    Don’t get me wrong, I’d rather accomplish this with just a single addon, but it works and it’s a better solution than what I’d be able to do myself ! :-)

    Thanks,

    Stephen

  31. 31 Low June 21st 2010, 10:13

    Hey Stephen,

    You’re right, that’s one way of getting to the last segment. Or you could use the method I described here to get {last_segment} as a global variable, and use that as your input.

Leave a comment



Some html (a, em, strong, etc) allowed.
Email won’t be displayed and takes care of your Gravatar.