Zenpage: read more link present, but not needed

I set the length of an news article to 5000. This way an article will be shown full, unless the page break is added manually in the editor. Nevertheless the 'read more' link is shown. Why? Should I delete that php line in the news.php file?

Comments

  • acrylian Administrator, Developer
    Yes, the read more link is already handled by the printContent() function. The separate function mainly exists for flexibility reasons.
  • Then I think I don't know what I'm doing wrong. I have this code:

    `

    <?php printNewsContent(); ?>

    <?php printNewsReadMoreLink('Lees verder...'); ?>


    `
    The link is shown for short articles with full text and for larger articles with page breaks. In both cases the read more link is visible.
  • You would not need the line:
    <p class="readmore"><?php printNewsReadMoreLink('Lees verder...'); ?></p>
    then.
  • When I delete that line, there is no more link present for the visitor to the entire article, other than clicking on the title of the article. But I would prefer a link at the bottom of the article.
  • acrylian Administrator, Developer
    If your content is shortened there should be a read more link automatically. Try the Zenpage theme. If it does work there and not in your theme, you have some work to do..;-)
  • I tried the Zenpage theme. With the printNewsReadMoreLink present it shows the link to the rest of the article (past the pagebreak), but also when the article is short and has no pagebreak. When I remove the printNewsReadMoreLink from the news.php template, no read more link is shown. In that case I have to click on the title to read the rest.

    I set the lenght of the news article at 5000.
  • acrylian Administrator, Developer
    I can't reproduce that issue: zenphoto.maltem.de (plain 1.3 install)

    The first article is automatically shortened by the option settung (700 in this case) and the 2nd via a pagebreak. `printNewsReadMoreLink` is commented out.
  • Thanks for testing. I will test some more myself. Must have forgotten something :(
  • I'm getting hopeless :-). I can't imagine what could be wrong. Like I said, a new 1.3 install, using the standard zenpage theme for testing, and no seperate readmore link present. I just can't get the automatic read more link to be shown. Some posts have a page break, some don't. Some are long, some short. When I view the source of the newspages, there is no hidden read more link visible. I know you can only test it for yourself, but perhaps some other users encountered this same problem.

    The host is using MySQL 5.0.45 and PHP 5.2.13 by the way.
  • acrylian Administrator, Developer
    Since you use a custom theme, how do you call the content? The automatic read more link only works with `printNewContent` not with the `getNewsContent()` variant. btw, have link maybe?
  • For your convenience :) I activated the default ZenPage theme: http://www.degroeneman.nl/news so the the content is defenitely called by printNewsContent.
  • acrylian Administrator, Developer
    Well, I see it but I have really no idea (as it is working on my test site). There actually no specifc PHP stuff or so involved... (BTW, I remembered wrong, the truncating is done in getNewsContent()).

    IF you want take a look at line 429/455-468 of zenpage-template-functions.php, there it is done.
Sign In or Register to comment.