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.

Read More Link

May 03, 2008 5:07am

Subscribe [3]
  • #1 / May 03, 2008 5:07am

    simsa

    14 posts

    How can i remove the p tags from the Read more link?

    my current code is:

    {if extended}<a href="http://{homepage}/{my_template_group}/{my_comments_template}/{url_title}">Read on…</a>{/if}

    which does not encloses “Read on…” into the last p tag of the field… which i want.

    Moderators note: Split from this thread.

  • #2 / May 03, 2008 5:19am

    Ingmar

    29245 posts

    You probably want to change formatting to “None” instead of “XHTML”.

  • #3 / May 03, 2008 5:33am

    simsa

    14 posts

    Hi Ingmar,
    no not really.. i like the extended field havin p tags and so on ... just the “read more link” should be inlined.
    Know what i mean?

    [du sprichst doch deutsch, Ingmar, oder? ich möchte einfach nur die umschließenden p tags um den Link loswerden. Das extended field soll mit p tags formatiert werden]

  • #4 / May 03, 2008 6:12am

    Ingmar

    29245 posts

    Do you have a link to the site where it’s happening? Or could I see more of your template? If it’s inserted by the Typography class, there really is no other option than turning it off.

    [simsa, yes, I do speak German, but most other people here don’t. So I consider it a question of politeness, if nothing else, to keep it to English.]

  • #5 / May 03, 2008 6:46am

    simsa

    14 posts

    This is an EE site: http://refreshthetriangle.org/ and on the right hand side you find articles where the “Read more” link is enclosed in the last paragraph of the body text.

    I am sure EE supplies a (dynamic) solution for that… though i perfomed a couple of searches on the issue i did not come across any solution yet.

  • #6 / May 03, 2008 7:24am

    Ingmar

    29245 posts

    This is not your site, is is? Can I see the code you’re using, please?

  • #7 / May 03, 2008 7:51am

    Ingmar

    29245 posts

    OK, look at this link: http://exp-consulting.net/test/readmore/71
    Does that do what you want? Here’s the code I’m using:

    {exp:weblog:entries limit="1" disable="member_data|trackbacks"}
    
       <h2 class="title">{title}</h2>
       {summary} <a href="http://{permalink=site/comments}">Read more.</a>
    
    {/exp:weblog:entries}

    Oh, and {summary} needs to have “Formatting: None” or “Auto
    “. If you use XHTML, the {summary} pargraphs will be wrapped in tags, and “Read more” will be inserted after such a closing tag, causing a visible linebreak.

    Shifting to Howto, by the way, not really a Tech Support issue.

  • #8 / May 03, 2008 9:06am

    simsa

    14 posts

    Thx for your help Ingmar.
    So in short, there is no way to insert the “Read more” link to the last paragraph of a (summary) field.

    (Coming from Textpattern, this was a longtime request by the users overthere until someone wrote a plugin. thought it is posible with EE too.)

  • #9 / May 03, 2008 9:11am

    Ingmar

    29245 posts

    Oh, I’m pretty sure it would be possible with a plugin. There’s just no built-in way that I am aware of.

  • #10 / May 03, 2008 9:39am

    Mark Bowen

    12637 posts

    As Ingmar has mentioned this would probably be possible with a plugin but as far as ExpressionEngine stands at the moment it leaves those kind of operations down to whatever you as the programmer place into your templates. I really really like this fact that ExpressionEngine makes no assumptions as to what you want in your templates and the fact that it totally abstracts the data from the template side of things is just in my mind the most powerful feature of EE.

    What I like to do on sites also is have a simple conditional surrounding my read more links so that if there isn’t anything more to read then there isn’t a link shown. Something like this :

    {if extended != ""}
    <a href="http://{url_title_path=" title="Read - {title}">Read more…</a>
    {/if}

    This is a great feature to add into a site as it literally only takes a second to do but makes your sites much more easier for people to navigate around. I personally don’t like clicking on Read more… links that just take you to a page that has the exact same text on that you just read as it kind of defeats the object of the link in the first place 😉

    As Ingmar said though you could probably do something with a plugin although I think that it would probably be the sort of plugin that would be quite specific to your own setup and may not work on all sites without a bit of modification.

    Best wishes,

    Mark

  • #11 / May 03, 2008 10:03am

    simsa

    14 posts

    I personally don’t like clicking on Read more… links that just take you to a page that has the exact same text on that you just read as it kind of defeats the object of the link in the first place ;-

    Hi Mark,
    you are an angel along with Ingmar, 😊 i was already thinking about removing useless “Read more links”.... thanks for the bit of code!
    The EE docs are pretty comprehensive and take a long time for newbies to find through.

    BTW your opinion on the weblog/section issue was sooooo ignorant… don´t you have a bit of heart for us foreigners? (just kidding 😉) have a nice day…

  • #12 / May 04, 2008 6:26pm

    Mark Bowen

    12637 posts

    Hi Mark,
    you are an angel along with Ingmar, 😊 i was already thinking about removing useless “Read more links”.... thanks for the bit of code!
    The EE docs are pretty comprehensive and take a long time for newbies to find through.

    No problem. Just a nice way to stop people getting fed up with the same content I always think 😉

    BTW your opinion on the weblog/section issue was sooooo ignorant… don´t you have a bit of heart for us foreigners? (just kidding 😉) have a nice day…

    Not too sure what you are referring to there? Also sorry or being ignorant. If whatever you are referring to wherever you are referring to has come across as ignorant then I apologise as I try my best to not be.

    Best wishes,

    Mark

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

ExpressionEngine News!

#eecms, #events, #releases