1. NOTICE: If you are using Fabrik and update to Joomla 3.10, you will need to update to Fabrik 3.10. And, if you are using Fabrik, do not upgrade to Joomla 4, we do not have a supported version ready for release. More information on a release date coming soon. Also, please note that Fabrik 3.10 will not install on any Joomla sites less than 3.8.
    Dismiss Notice

difficulty with calc field in layout

Discussion in 'Community' started by germanoalves, Sep 17, 2021.

  1. germanoalves

    germanoalves Member

    Level: Community
    Hi! I'm using the calc field to display information from another dropdown field. However, in the layout I export in PDF, the items appear with a 'dot' before them.

    I've tried removing this via inline CSS, inside the field, and I was unsuccessful.

    Has anyone been through this and was successful in customizing it?

    Thanks!
     
  2. troester

    troester Well-Known Member Staff Member

    Level: Community
    Enable "Debug PDF" in Fabrik Options, this will display the HTML generated for the PDF on your screen (on the screen you perhaps won't see the dots).
    Examine the calc (HTML structure, classes) for what to set e.g. in your custom PDF layout CSS.
     
    germanoalves likes this.
  3. germanoalves

    germanoalves Member

    Level: Community
    thanks for the answer @troester

    But it did not work :(

    When I activate the PDF debugging, I located the HTML structure and Classes, I assembled the CSS, I inserted the PDF template layout, but when I disable the debugging, the problem remains, there is a 'dot' before each item returned.

    Was there another solution?

    Thanks!
     
    Last edited: Sep 17, 2021
  4. lousyfool

    lousyfool Active Member

    Level: Community
    We're not seeing what you're doing.
    Please copy and paste your calc code here, and a screenshot of the area with that 'dot' in your PDF.
     
  5. germanoalves

    germanoalves Member

    Level: Community
    @lousyfool :


    Field Calc:
    upload_2021-9-17_18-12-31.png

    return '{table___Full Element Name}';


    Layout in PDF:

    upload_2021-9-17_18-11-16.png

    Thanks!
     

    Attached Files:

  6. lousyfool

    lousyfool Active Member

    Level: Community
    Is {table___Full_Element_Name} a multi-select dropdown, then rendering as <ul>?
    You'll then need CSS like <ul style="list-style: none;">
     
    germanoalves likes this.
  7. germanoalves

    germanoalves Member

    Level: Community
    Yes @lousyfool , it's multi-select dropdown and rendered as <ul>.

    I already insert in css "<ul style = "list-style: none;">"
    but it didn't work :(

    Would there be another way?
     
  8. troester

    troester Well-Known Member Staff Member

    Level: Community
    This is not really a Fabrik question...
    As I said:
    Examine with DebugPDF on your screen what is sent to the PDF lib.
    It doesn't matter if it's showing the dots on the screen, the browsers render a bit different from PDF libs.
    But you can check all computed CSS for ul and li etc.

    Are you doing the formatting yourself inside the calc or are you using the Fabrik formatting (i.e. calculating with {element_raw} or {element}?
    Fabrik repeat data has
    <ul class="fabrikRepeatData"..> <li>...
     
    germanoalves likes this.
  9. germanoalves

    germanoalves Member

    Level: Community
    Hi @troester !

    Inside the calc field is written:
    return '{table Full Element Name}

    When I activate the debug PDF, I can see the structure of the PDF template (td > ul > li), but when I customize "ul", "fabrikRepeatData" or "li", it just doesn't work, as if CSS doesn't be interpreted in the PDF template.

    I'm putting the CSS inside the PDF theme I created with '{element}'.


    Other CSS customizations for this theme worked fine, only this one didn't.

    Where am I wrong in this process I'm doing?

    Thanks to all for your help!
     
  10. germanoalves

    germanoalves Member

    Level: Community
    Hi @troester and @lousyfool !

    would there be anything else I can try to do to resolve this?
     
  11. troester

    troester Well-Known Member Staff Member

    Level: Community
    Not sure what you mean with "I already insert in css "<ul style = "list-style: none;">".
    This is not CSS but HTML.
    As I said: examine the source code with PDFdebug, what do you get exactly for your complete calc element?

    If you don't see the Fabrik repeatData class try to add something like
    ul {list-style: none!important;} to your custom_css.php of your PDF details template.
     
  12. germanoalves

    germanoalves Member

    Level: Community
    exactly @troester .
    The problem is when the pdf is generated, because when the pdf debug is enabled, the content works without 'problems'.

    I'll leave some screenshots of my theme below.

    this question is kind of desperate :(

    Sorry for the inconvenience of asking you this.

    Are there still other actions I can take?



    My custom_css.php


    upload_2021-9-23_17-23-30.png

    My template_css.php

    upload_2021-9-23_17-25-2.png


    My default.php with CSS

    upload_2021-9-23_17-26-36.png

    my html view (with debug pdf)
    upload_2021-9-23_17-33-17.png
     
  13. troester

    troester Well-Known Member Staff Member

    Level: Community
    DomPdf or mPdf?
    Only your calc or any "RepeatData"?
     
  14. germanoalves

    germanoalves Member

    Level: Community
    Hi @troester!

    mPDF

    I don't have any other repeat Data in my template or project.
    Is there anything else I can fix?
     
  15. troester

    troester Well-Known Member Staff Member

    Level: Community
    Add some repeat element to list view (e.g. your original element you use in the calc), what happens?
    Switch to domPDF, what happens?
     
  16. germanoalves

    germanoalves Member

    Level: Community
    @troester , i've already added another element and the same thing happens. The "dot" appears before each item.

    I've tried using domPDF and I wasn't successful, neither in this project nor in another project. The best I found was mPDF.

    Is there anything else I can do?
     
  17. troester

    troester Well-Known Member Staff Member

    Level: Community
  18. germanoalves

    germanoalves Member

    Level: Community
    ah... how difficult it is :(
    now I'm dead :(
     
  19. troester

    troester Well-Known Member Staff Member

    Level: Community
    I think as long as you are creating the output in a calc yourself you can use the raw data (or some string replacement) and modify ul li to something like
    aaa
    <br>
    bbb
     
  20. germanoalves

    germanoalves Member

    Level: Community
    @troester ,sorry for my little knowledge, but let me get this straight.

    would I have to create a structure with for example <p></p> inside the calc or in the template I'm creating?
     

Share This Page