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) Linking help needed!

November 20, 2007 9:14am

Subscribe [4]
  • #1 / Nov 20, 2007 9:14am

    tomas.b

    8 posts

    Hello!

    Probably a dumb question but you never know…
    Problem is that I want to link from my main page to a specific #div within the blog-posts (comment pages).

    The code I have looks like this:

    <a href="http://{url_title_path=">Read/view comments</a>

    ...and normally you would write (like in “back to top” links):

    <a href="http://whatever.htm#comments">Read/view comments</a>

    ...but I just can’t see how to do this (tried several different ways but nothing seems to work).

    /Tomas

  • #2 / Nov 21, 2007 4:39pm

    hothousegraphix

    851 posts

    Hey, you could try this if you want to hide anchor you’re linking to:

    <a href="http://{title_permalink=template_group/template}#comments_div">Read/view comments</a>

    and in your mark-up

    <div id="comments">
    <a name="comments_div"></a>
    //A bunch of stuff
    </div>
  • #3 / Nov 21, 2007 4:57pm

    Boyink!

    5011 posts

    Actually (I learned recently when doing the same thing) you can do the bookmark approach with just using the named div as your target.

    So using the above example:

    <a href="http://{title_permalink=template_group/template}#comments">Read/view comments</a>

    Edit…or…maybe this is the approach you were trying.  If so…carry on..nothing to see here….😉

  • #4 / Nov 22, 2007 5:41am

    tomas.b

    8 posts

    Thanks guys!

    I got it fixed last night and it seems like I did it like you suggested. Here is the code I came up with if anyone might be interested for future reference:

    {exp:weblog:entries weblog="{blog}" orderby="date" sort="desc" limit="7"}
    <div class="entry">
    
    <h2>{date_heading}{entry_date format='%Y.%m.%d'}{/date_heading}</h2>
    <p>{if link == ""}</p><h3>{title}</h3><p>{/if}<br />
    {exp:acronym}<br />
    {summary}<br />
    {if allow_comments}<a href="http://{url_title_path=">Read more…</a>{/if}<br />
    <div class="link-text">{link}</div><br />
    {/exp:acronym}</p>
    
    <p><ul class="inline right"><br />
    {if allow_comments}<br />
    <li>{if photos != ""}<a href="http://{title_permalink=%27{template}/articles%27}#photos" title="View the photogallery">{embed="include/photoLink"}</a>{/if}</li><br />
    <li><a href="http://{title_permalink=%27{template}/articles%27}#comments" title="Read/write comments">{embed="include/commentLink"}</a></li><br />
    <li><a href="http://{url_title_path=" title="View the full post">{embed="include/articleLink"}</a></li><br />
    {/if}<br />
    </ul></p>
    
    <p></div></p>
    
    <p>{paginate}<br />
    {if {total_pages} > 1}Page {current_page} of {total_pages}. <span class="page">{pagination_links}</span>{/if}<br />
    {/paginate}</p>
    
    <p>{/exp:weblog:entries}

    and on the articles page (commentpage):

    <a name="photos"></a>
    <a name="comments"></a>
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases