Results 1 to 7 of 7

Thread: [Solved] Setting Print Syndication for Accordions

  1. #1
    User
    Join Date
    03-23-10.
    Location
    Canada
    Posts
    34

    Default [Solved] Setting Print Syndication for Accordions

    I have been having quite a time getting the Syndication settings right for the Print options (well the PDF too for that matter, but that's a whole other issue I need to take up with the PDF output developer). I've had lots of problems printing what I want, previous post viewtopic.php?f=6&t=2603.
    Now the problem I'm having is that the articles I want printed often have accordions on them and only the heading for the accordion is printing, the text that is contained inside the accordion is not printing. All my other problems have been solved by creating a class and setting them to not be visible, but now my problem isn't to hide elements but to have them be visible. I don't know how to code elements as visible....isn't that the inherent value of everything first? What would the value be to make something visible?
    I had used { display: none; } to make things go away.
    Any ideas?

    An aside: Didn't have this problem before updating Contao and now the the Syndication options, I'm having to repair my whole site to make it do what it had previously been doing. Any ideas as to why this is happening? Are they bugs? Are we missing a new extension to make it work as it had previously? Or is it just the way it goes?

  2. #2
    User
    Join Date
    10-15-10.
    Posts
    279

    Default Re: Setting Print Syndication for Accordions

    generally the opposite of display: none is display: block. just like visibility: hidden and visibility: visible

  3. #3
    Experienced user
    Join Date
    01-12-10.
    Posts
    814

    Default Re: Setting Print Syndication for Accordions

    I am assuming the problem is that you do not know what to change in which place under normal circumstances. Otherwise my reply won't help... Otherwise I have misunderstood you.

    When printing a page that page is rendered using the stylesheets that had media defined as all and print. I'm not really sure if the current state of the DOM tree is used or that the original html is printed. You would most likely need to define in the printing stylesheet a class that targets the hidden elements and shows them. Perhaps adding the parameter !important to make sure this is used.

    I'm not sure which is the correct CSS selector, suppose it is ".block ul li.accordion-item". The CSS you need to add to the print CSS stylesheet would be:
    Code:
    .block ul li.accordion-item {
      display: block !important;
    }
    Again, the selector is almost certainly wrong. Note that the !important keyword is not needed if the selector itself is strong enough.

    If that doesn't work you would need to figure out what the accordion script changes in the accordion and undo that before printing...

  4. #4
    User
    Join Date
    03-23-10.
    Location
    Canada
    Posts
    34

    Default Re: Setting Print Syndication for Accordions

    Thanks for the input. Nothing has worked yet. I have found other suggestions elsewhere, most point back to this page http://davidwalsh.name/mootools-accordion-print, but nothing mentioned there or here has worked for us. If I open an accordion and then hit print, it will print the open one, but only the headline for the others. As presented on the davidwalsh site, it is like the accordions are stuck at 0 line height, but nothing I do in CSS will make all of them all open for printing.
    fyi if anyone else needs the info: The selector is .accordion for the text content and .toggler for the section headline.
    This wasn't a problem before updating from Typolight to the most recent Contao. Very odd that in an update the default value for printing would be changed. Something had to have been changed if it used to work and now doesn't? I can't see it being terribly beneficial to print closed accordions. Terribly confused.

  5. #5
    Experienced user
    Join Date
    06-20-09.
    Posts
    1,311

    Default Re: Setting Print Syndication for Accordions

    What version of Typolight was it working for you Michelle?
    Changes are documented here http://www.contao.org/changelog.html (find on page "pdf")
    Its possible you were using a different generator then (DOMPDF not TCPDF)

    EDIT: whoops, I got confused ... Ignore ops:

  6. #6
    Experienced user
    Join Date
    01-12-10.
    Posts
    814

    Default Re: Setting Print Syndication for Accordions

    Is it a Mootools or a CSS problem. I suggest you disable all javascript, reload the page and print. If the problem persists it is CSS and should be easy to solve. Figure out which selector makes display go bad (trial-and-error) and override with a stronger selector in your print stylesheet.

    If the problem has gone this is a Mootools problem. I use jQuery instead so I wouldn't know what the problem for Mootools is. But if you go trough the code you should be able to figure some things out between old and new variant. Can Mootools detect if the page is being made ready to print? If so unfold all .accordion before and undo after. Otherwise add a print button?

  7. #7
    User
    Join Date
    03-23-10.
    Location
    Canada
    Posts
    34

    Default [Solved] Re: Setting Print Syndication for Accordions

    Got it fixed with CSS. I wasn't following the fix reported on the other guy's website. He had .element as the selector and seeing that it was only supposed to be talking about accordions not printing, I took at as literal that .element was the selector, but in thinking in through today that made no sense to me. So although I thought I had tried this option once already and hadn't had luck, I tried it and it works now!

    For anyone else having this issue this is what I did...

    In a css file soley for print media, I put this as selector:
    .accordion
    and this in the custom css:
    height:auto !important;

    Now it prints the content in the accordions. For other beginners who are having issues with items not printing correctly on pages, further info....
    I also have in that same print.css file several selectors (like #header, #left for the left column and some other custom items) that are showing up on the printed pages that I don't want to show up. I put display:none; in the Custom Code to make them go away on the printed page.

    Thank you to you all for helping me work through it.
    Now I just need to solve the issue of any [nbsp] in the html making my pdf's render to blank pages, at least that seems to be the determining factor, anyway.... I'm off to work on that.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •