Support » Plugin: CataBlog » Using excerpt for category page but description for lightbox

  • Resolved dan257



    I was wondering if it’s possible to use the EXCERPT token in the category page for products, but when the lightbox is activated, to show the full DESCRIPTION.

    The reason is because I have products that have some very long technical specifications, and to show them all in the category page will mean that people have to scroll a lot just on a page.

    I’ve looked through the source and it seems that I will need to change something in the frontend_render_catalog_row() function in Catablog.class.php, but I can’t seem to get it to work. The only temporary workaround I found was to create a hidden div and call that in catablog.lightbox.js.

    Please, if anyone can suggest a solution that will be very helpful and appreciated. Thank you in advance!

Viewing 11 replies - 1 through 11 (of 11 total)
  • Hello dan257, have you tried to simply edit the template that you are currently using under CataBlog settings? For example see one of the templates used.

    <div class=”catablog-row %CATEGORY-SLUGS%”>
    <h3 class=”catablog-title”>%TITLE-LINK%</h3>
    <div class=”catablog-description”>

    All you have to do is use the EXCERPT token instead of DESCRIPTION token. You can also check the following post.

    Let me know if this helps you.

    Kind regards

    Hello mbrsolution,

    Thank you for the suggestion. Yes in fact I have tried replacing the %DESCRIPTION% token with %EXCERPT% for the Default template.

    This makes the product description in the category page truncated, which is good. Unfortunately it also makes the lightbox description truncated, which is not good – I need the lightbox to display the full product description.

    I think the problem is in the catablog.lightbox.js file – the lightbox takes the HTML from the catablog-description div, if I’m not mistaken.

    I’m not that good at coding, so I’ve been trying to research more on how to do this. Would appreciate any more pointers if you have 🙂

    Hi dan257, have you also looked in the following:

    CataBlog >> Options >> Description and change the settings there?

    Kind regards

    Hi mbrsolution,

    Yes, I’ve enabled WordPress filters and Render line breaks. I’ve also set Excerpt length to my desired length of 250 characters.

    So now my product description in the category page shows 250 characters, but when I click on the product image and lightbox pops up, its also 250 characters. I need the lightbox description to be the full description (could be anything from 500 to 700 characters).

    Hi dan257 could I see a link to your website?

    Hi dan257, I read in Zach’s blog the following:

    Good question! Here is what I would do, in your template make two <div /> tags, one with the description and one with the excerpt. Make sure the div with the description inside it has a class of catablog-description. Now use your own CSS classes to hide the description but not the excerpt. Example:

    <div class="catablog-excerpt">%EXCERPT%</div>
    <div class="catablog-description my-class-hide">%DESCRIPTION%</div>

    I hope this helps you.

    Kind regards

    Hi mbrsolution,

    Yes in fact that was what I did before I came to the support forum 🙂

    I guess this is the best solution for now! Thank you very much for your suggestions and your effort, I appreciate it very much!


    Any chance you could please shed some light on the CSS needed to hide the excerpt and description?

    Hi @mahgo, if you click on the link I provided above which directs you to Zach’s post you will find your answer there. Also you might want to use firebug in firefox browser to check which is your css class that you might have to address.

    I hope this points you in the right direction.

    Kind regards

    Ok thanks!

    You are most welcome @mahgo and @dan257 🙂

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Using excerpt for category page but description for lightbox’ is closed to new replies.