-
AuthorPosts
-
September 9, 2024 at 3:46 pm #1466524
Kreisi:
I have a challenge that I am hoping will be fairly simple. Please see this page noted in Private Content
On this page you will see three screen square images with text to the right of each. The text at right is in Text Blocks for “Lesson Tuition,” “Preschool Fees,” and “Music To______ Fees. Each of these blocks is set for folded content.
I would like to have a link from another page that links directly to one of these blocks (Preschool Fees) kind of like linking to an anchor, but I would like that specific content (Preschool Fees unfolded). Is this possible? And how?
As a secondary issue the three “headings” with green backgrounds for each of the above blocks are built using the “notification” content element shortcode. You’ll see that the top one of the three extends longer (desired) with equal margins on left and right, whereas the other two are displaying shorter. I cannot figure out what is causing this.
Thank you —Bill Basler
September 9, 2024 at 7:16 pm #1466556Hey William,
You can add an ID to Grid in the element options, then you can link to it like the example in private.
Please try this in Quick CSS to align the buttons:
.page-id-2103 .avia-fold-unfold-section .av-fold-unfold-container .avia_textblock { display: block; }
Best regards,
RikardSeptember 10, 2024 at 6:18 pm #1466637Rikard:
Thank you for this. On the custom ID solution. This is working, in that it is taking me to the correct page and loading the correct text block. But…I am using folded content on this block. I would like the content to be unfolded upon, or shortly after page load.
September 11, 2024 at 11:48 am #1466694Hi,
Thank you for the update.
The site it not loading on our end. Did you transfer the site to a different domain?
Best regards,
IsmaelSeptember 11, 2024 at 2:50 pm #1466719No change to the domain. Please see my notes in Private Content
September 12, 2024 at 3:35 am #1466763Hi,
We cannot load the site on our end. Did you block specific countries from accessing it? Please unblock the following countries: the Philippines, Lithuania, Sweden, and Austria.
Best regards,
IsmaelSeptember 12, 2024 at 6:17 pm #1466838I have double-checked all server, site and firewall settings. I have browsed the URL by the countries that you indicated, and I see no issues from any, Philippines, Lithuania, Sweden, and Austria, using https://geotargetly.com/geo-browse
If this continues, please grab a screen shot of the error and send to me. We cannot seem to replicate the error.
September 13, 2024 at 4:51 am #1466870Hi,
This is what we get when we visit the site: (see private field)
Best regards,
IsmaelSeptember 16, 2024 at 3:22 pm #1467108Site is now live. See new URL in private content
September 17, 2024 at 4:46 am #1467159Hi,
Thank you for the info.
Add unique class names to the Text Block elements with the fold/unfold option, such as av-fold-unfold-tuition-fees, av-fold-unfold-preschool-fees, etc. Then, create anchor links like https://site.org/fee-structure/#tuition-fees. To automatically trigger the fold/unfold on page load when a specific anchor or hash is present, include the following script in the functions file.
function ava_script_fees_click() { ?> <script type="text/javascript"> (function ($) { $(document).ready(function () { function triggerClick(hash, container) { if (window.location.hash === hash) { $(container + ' .av-fold-button-container').trigger('click'); } } triggerClick("#tuition-fees", ".av-fold-unfold-tuition-fees"); triggerClick("#preschool-fees", ".av-fold-unfold-preschool-fees"); triggerClick("#music-together-fees", ".av-fold-unfold-music-together-fees"); }); })(jQuery); </script> <?php } add_action('wp_footer', 'ava_script_fees_click', 9999);
Best regards,
IsmaelSeptember 17, 2024 at 6:05 pm #1467223Ismael, thank you for the response. I have edited functions.php files before so I am comfortable with how to do that. However, I am not comfortable writing php…just kind of OK with viewing the code, and determining what it is doing.
The end goal happens on this page: https://preucil.org/fee-structure/
There are essentially 3 content “chunks” on this page:
1. Lessons. #lesson-fees
2. Preschool. #preschool-fees
3. Music Together. #music-together-feesThe three blocks have Custom ID Attribute assigned to them.
Now….this page is an example page: https://preucil.org/about-preucil-preschool/
On this page there is a sentence that reads: A full itemization of our preschool academic programs and fees can be viewed here. On this sentence “viewed here” links to: https://preucil.org/fee-structure/#preschool-fees and properly goes to that Custom ID. But I am wanting that folded content to be unfolded. Judging by the php edits, I think you are grasping what I am needing.After adding the snippet to functions.php, it does not seem to be unfolding the content as it should. I suspect there is something I need to edit within this text:
triggerClick(“#tuition-fees”, “.av-fold-unfold-tuition-fees”);
triggerClick(“#preschool-fees”, “.av-fold-unfold-preschool-fees”);
triggerClick(“#music-together-fees”, “.av-fold-unfold-music-together-fees”);For example, “lesson-fees” rather than “tuition-fees”?
As mentioned I have no experience in editing php, so I am in over my head here. In short, I have added the php snippet, but no positive results.
September 18, 2024 at 6:07 am #1467273Hi,
For example, “lesson-fees” rather than “tuition-fees”?
Yes, you need to update the selector to “lesson-fees” and make sure that the class names (e.g., av-fold-unfold-preschool-fees) of the Text Blocks correspond to the anchor links (e.g., #lesson-fees, #preschool-fees). If it’s not working, please provide the WP login info in the private field and make sure that the Appearance > Theme File Editor is accessible.
Best regards,
IsmaelSeptember 18, 2024 at 3:47 pm #1467331Ismael, thank you again for your help. I think we are on the same page with the additions to function.php, but it does not seem to be working.
I have added a kriesi user login in Private Content. Please review if you can. I have your suggested function.php snippet inserted.
Thank you,
Bill Basler
September 19, 2024 at 6:02 pm #1467474I am wondering if this is currently being worked on. It appears that my Custom ID names are different than they were?
September 20, 2024 at 4:47 am #1467498Hi,
I am wondering if this is currently being worked on.
Yes, we edited the script yesterday and updated the element attributes, but for some reason, the modification is not working. We’ve forwarded the issue to our channel and notified the rest of the team. We’ll get back to you once we have an answer.
Best regards,
IsmaelSeptember 27, 2024 at 3:50 pm #1467969Any update on this Ismael?
Thank you.
September 29, 2024 at 8:22 am #1468041i do not see your selectors at all on your page
f.e. i see no class: av-fold-unfold-tuition-feesi see only ID’s concerning to your buttons:
#av-fold-unfold-lesson-fees
#av-fold-unfold-preschool-fees
#av-fold-unfold-music-together-feesthere are changes in your setting ( names ) and these selectors are ID’s
so may be try this instead:
function ava_script_fees_click() { ?> <script type="text/javascript"> (function ($) { $(document).ready(function () { function triggerClick(hash, container) { if (window.location.hash === hash) { $(container).find('.av-fold-button-container').trigger('click'); } } triggerClick("#lesson-fees", "#av-fold-unfold-lesson-fees"); triggerClick("#preschool-fees", "#av-fold-unfold-preschool-fees"); triggerClick("#music-together-fees", "#av-fold-unfold-music-together-fees"); }); })(jQuery); </script> <?php } add_action('wp_footer', 'ava_script_fees_click', 9999);
September 30, 2024 at 4:16 am #1468076Hi,
We still haven’t figured out why the click event for the read more button can’t be triggered automatically.
there are changes in your setting ( names ) and these selectors are ID’s
@Guenni007: We’ve already updated the attributes of the elements and edited the code in the functions.php, but the click trigger is still not working as expected. Thanks for checking.Best regards,
IsmaelSeptember 30, 2024 at 11:21 am #1468096although it waits until the DOM is loaded – maybe a timing delay is working?
function ava_script_fees_click() { ?> <script type="text/javascript"> (function ($) { $(document).ready(function () { function triggerClick(hash, container) { if (window.location.hash === hash) { setTimeout(function() { $(container).find('.av-fold-button-container').trigger('click'); }, 300); } } triggerClick("#lesson-fees", "#av-fold-unfold-lesson-fees"); triggerClick("#preschool-fees", "#av-fold-unfold-preschool-fees"); triggerClick("#music-together-fees", "#av-fold-unfold-music-together-fees"); }); })(jQuery); </script> <?php } add_action('wp_footer', 'ava_script_fees_click', 9999);
October 1, 2024 at 4:13 am #1468132 -
AuthorPosts
- You must be logged in to reply to this topic.