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 show Title of the Entries in Browser Title Bar?

May 27, 2011 6:16pm

Subscribe [4]
  • #16 / May 31, 2011 2:56pm

    Ibn Saeed

    98 posts

    Several different approaches that I’m aware of:

    - you can use a separate channel entries tag pair to pull up the title (using the same setup and parameters as you do in the body)

    I followed the above way, but wouldnt running the channel entries multiple times on the same page, effect the sites performance? Is there any better way ?

    - there’s one or more add-ons on devot-ee.com that will temporarily cache a value from your entries pair in the site body and therein allow you to use it in the header or elsewhere in your template outside of the confines of the original entries tag pair, and then you wouldn’t have the inefficiency of duplicating the channel entries call.

    I searched and found Low Title Addon
    http://loweblog.com/software/low-title/

    Testing it right now, trying to get it to work the way i want it.

  • #17 / May 31, 2011 2:58pm

    Boyink!

    5011 posts

    You have the tools to measure that - does it? 😊

    However there should be no need to have 2 channel enties tags on a single entry template. Just put the embed inside the main tag pair n

  • #18 / May 31, 2011 3:10pm

    Ibn Saeed

    98 posts

    However there should be no need to have 2 channel enties tags on a single entry template. Just put the embed inside the main tag pair n

    Did your message cut off ?

    How do I put the embed inside the main tag pair ? can you explain what you mean by that ?

    Here is my entry page code:

    {embed="includes/document_header" page_title="{exp:channel:entries channel="news_articles" status="open|Featured Top Story|Top Story" limit="1" disable="member_data|trackbacks|pagination"} | {title}{/exp:channel:entries}"}
    <body class="home">
    <div id="layoutWrapper">
        {embed="includes/masthead_navigation"}
        <div id="content">
            <div id="article">
                {exp:channel:entries channel="news_articles" status="open|Featured Top Story|Top Story" limit="1"}
    
                {article_image}
                <h4>{title}</h4>
    <p>            </p><h5><span class="by">By</span> {article_author}</h5>
    <p>            {entry_date format="%M %d, %Y"} -- Updated {gmt_edit_date format="%M %d, %Y"}<br />
                {exp:pagination paginate="bottom" uri_trigger="page_"}<br />
                {article_body}<br />
                {simplepaginate}<br />
                {if {total_pages} > 1}<br />
                <br />
                   <!--Page {current_page} of {total_pages} pages -->   {pagination_links} <br />
                </p>
    
    <p><br />
                <!--<br />
    Total Pages: {total_pages}--></p>
    
    <p>            {/if}<br />
                {/simplepaginate}<br />
                {/exp:pagination}</p>
    
    <p><br />
                {/exp:channel:entries}<br />
            </div>

    What do i change?

  • #19 / May 31, 2011 3:15pm

    Ibn Saeed

    98 posts

    I tried the following, is this what you meant ?

    it does work, but its quite an odd way. The channel:entries Opening tag is in the embed tag and its Closing Tag is below where I want the code to end.

    Is this the correct way to do it ?

    {embed="includes/document_header" page_title="{exp:channel:entries channel="news_articles" status="open|Featured Top Story|Top Story" limit="1" disable="member_data|trackbacks|pagination"} | {title}"}
    <body class="home">
    <div id="layoutWrapper">
        {embed="includes/masthead_navigation"}
        <div id="content">
            <div id="article">
    
    
                {article_image}
                <h4>{title}</h4>
    <p>            </p><h5><span class="by">By</span> {article_author}</h5>
    <p>            {entry_date format="%M %d, %Y"} -- Updated {gmt_edit_date format="%M %d, %Y"}</p>
    
    <p>            {exp:pagination paginate="bottom" uri_trigger="page_"}<br />
                {article_body}<br />
                {simplepaginate}<br />
                {if {total_pages} > 1}<br />
                <br />
                   <!--Page {current_page} of {total_pages} pages -->   {pagination_links} <br />
                </p>
    
    <p><br />
                <!--<br />
    Total Pages: {total_pages}--></p>
    
    <p>            {/if}<br />
                {/simplepaginate}<br />
                {/exp:pagination}</p>
    
    <p><br />
    {/exp:channel:entries}

  • #20 / May 31, 2011 3:20pm

    Boyink!

    5011 posts

    More or less.

    I typically just do (simplified):

    {exp:channel:entries}
      {embed="embeds/page_header" my_title="{title}"}
      <h1>{title}</h1>
      {other_content}
    {/exp:channel:entries}
  • #21 / May 31, 2011 3:25pm

    Ibn Saeed

    98 posts

    More or less.

    I typically just do (simplified):

    {exp:channel:entries}
      {embed="embeds/page_header" my_title="{title}"}
      <h1>{title}</h1>
      {other_content}
    {/exp:channel:entries}

    The reason i asked was that you also used the channel tag pair twice in your tutorials.
    Here: http://www.train-ee.com/courseware/free-tutorials/comments/12-adding-product-specific-pages/

    {embed="embeds/html_header" my_page_title="Product Detail {exp:weblog:entries weblog="products" limit="1" disable="member_data|trackbacks|pagination" } | {title}{/exp:weblog:entries}"}
    <body>
        <div id="content">
            {embed="embeds/logo_title"}
            {embed="embeds/main_nav" my_location="products"}
            {embed="embeds/search_section_intros" the_url_title="products"}
            <div id="maincontent">
                <div id="right_side">
                    {embed="embeds/latest_news"}
                    {embed="embeds/latest_products"}
                </div><!-- close right_side -->
                <div id="left_side">
                   {exp:weblog:entries weblog="products" disable="member_data|trackbacks" limit="1"}
                   <h2 class="underline">{title}</h2>
                        {product_image}
                        Number: <strong>{product_number}</strong><br>
                        Color: <strong>{product_color}</strong><br>
                    Dimensions: <strong>{product_dimensions}</strong><br>
                        Weight: <strong>{product_weight}</strong><br>
                        <br>
                        <br>
                        {product_description}
                    {/exp:weblog:entries}
                </div><!-- close left side div -->
            </div><!-- close main content div -->
            {embed="embeds/footer"}
        </div>    <!-- close content div -->
       </body>
    </html>


    So have you stopped using the tag pairs twice , as you did in your tutorials ?

  • #22 / May 31, 2011 3:31pm

    Boyink!

    5011 posts

    On single entry templates, yes.

  • #23 / May 31, 2011 3:33pm

    Ibn Saeed

    98 posts

    On single entry templates, yes.

    Any good reason ?

    Is it performance?

  • #24 / May 31, 2011 3:34pm

    Boyink!

    5011 posts

    Performance and efficiency.

  • #25 / May 31, 2011 3:38pm

    Ibn Saeed

    98 posts

    Thanks for your help Michael

    This solves the issue and my question of performance.

    ill stick to using the embed variable method vs using Low Title or SEO title addons.

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

ExpressionEngine News!

#eecms, #events, #releases