WordPress.org

Ready to get started?Download WordPress

Forums

CataBlog
[resolved] Using excerpt for category page but description for lightbox (12 posts)

  1. dan257
    Member
    Posted 1 year ago #

    Hi,

    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!

    http://wordpress.org/extend/plugins/catablog/

  2. mbrsolution
    Member
    Posted 1 year ago #

    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%”>
    <div>
    %MAIN-IMAGE%
    %SUB-IMAGES%
    </div>
    <h3 class=”catablog-title”>%TITLE-LINK%</h3>
    <div class=”catablog-description”>
    <p>%PRICE%</p>
    <p>%DESCRIPTION%</p>
    %BUY-NOW-BUTTON%
    </div>
    </div>

    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

  3. dan257
    Member
    Posted 1 year ago #

    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 :)

  4. mbrsolution
    Member
    Posted 1 year ago #

    Hi dan257, have you also looked in the following:

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

    Kind regards

  5. dan257
    Member
    Posted 1 year ago #

    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).

  6. mbrsolution
    Member
    Posted 1 year ago #

    Hi dan257 could I see a link to your website?

  7. mbrsolution
    Member
    Posted 1 year ago #

    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

  8. dan257
    Member
    Posted 1 year ago #

    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!

  9. mahgo
    Member
    Posted 1 year ago #

    Hi,

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

  10. mbrsolution
    Member
    Posted 1 year ago #

    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

  11. mahgo
    Member
    Posted 1 year ago #

    Ok thanks!

  12. mbrsolution
    Member
    Posted 1 year ago #

    You are most welcome @mahgo and @dan257 :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic