Support » Plugin: Visibility Logic for Elementor » Potential race condition issue with Elementor TOC

  • Resolved mulli.bahr

    (@mullibahr)


    Pre-sale questions:
    1. Is there support for ACF pro?
    2. I have seen a problem that using PHP condition a section is hidden.
    That works fine.
    But, Elementor Table of Content, already detected the tag to be hidden
    And now it points to a dead (hidden) link.
    Does the pluging have a solution to that (like running before TOC)?

    Thanks
    Mulli

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hey there,

    Thanks for reaching out

    With respect to the questions here:

    1.Yes the plugin is supported.

    2. Do you mind sharing the replication steps to this so that we are all on the same page here?

    I look forward to your reply

    Kind Regards

    Thread Starter mulli.bahr

    (@mullibahr)

    Replication steps:
    1. Gnenerte Post with 3 ACF fields: hdr1, hdr2, hdr3.
    2. Generate Elementor post template with 3 sections (at least), to display the post.
    2.1 In each section put header widget with dynamic field set to hdr1,2,3 respectively.
    2.2 Use visibility on section to display only if ACF field not empty.
    Use PHP code to perform the test. Somthing like:

    $v = get_field('hdr1'); // default is current post id
    return ($v && !empty($v)); // true if not empty 

    3. Add table of contents, in a new section before those above.

    Tests:
    1. set post acf fields – to have some values & display
    TOC Result should be OK – all headers are shown in TOC and in sections.
    2. set acf field hdr2 to empty. hdr1, hdr3 – not empty.
    Result:
    hdr2 is not displayed, other are visible – visibility works fine
    BUT, TOC result NOT OK, the entry for hdr2 is shown and points to non-exiting anchor tag!

    Hope it helps

    • This reply was modified 5 months, 3 weeks ago by mulli.bahr.
    • This reply was modified 5 months, 3 weeks ago by mulli.bahr.
    • This reply was modified 5 months, 3 weeks ago by mulli.bahr.
    Thread Starter mulli.bahr

    (@mullibahr)

    There is an option to get in sync with Elementor TOC (ETOC):
    ETOC will exclude elements (e.g. sections) if the have user defined selector.
    For example: if a section has .hide-me selector, and ETOC is configured to exclude it,
    this section will not appear.

    Question: is there a way to add selector using your plugin?

    To be more specific, the following is a rough idea:

    $v = get_field('hdr1'); // default is current post id
    if (!$v || empty($v)) // no data, hide me
       add-css-selector-to-myself(".hide-me"); // true if not empty 
    Thread Starter mulli.bahr

    (@mullibahr)

    Finally, I found a bypass to visibility plugin.
    Since I already use ACF which elementor supports,
    The user checks which sections to hide/display
    And this data is included/excluded from table of contents.

    Plugin Author StaxWP

    (@staxwp)

    hi, I am glad to hear to hear you found a way for this!

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.