mehmetba
Forum Replies Created
-
hi, any updates please? Thanks.
thanks for your reply.
on the browser,
https://mysite.com:443/health gives a 404 page, but
https://mysite.com:443/typesense/health
gives
{“ok”:true}
Forum: Plugins
In reply to: [Custom Content Shortcode] Loop if an ACF flexible field is not emptyThanks again for your engagement. I’ve tried the following, to no avail. Displays nothing.
[pass global=route] [-pass list='damages,admissibility'] [loop exists type=case taxonomy=arbitrator term='{FIELD_2}']<br> <br> [the-loop] [if field={ITEM}] [field title-link] [flex {ITEM}] [layout fet-text] <p class="single_acf_text">[field fet-text]</p> [/layout] [layout fet-select] <p class="single_acf_select">[field fet-select]</p> [/layout] [/flex] [/if] [/the-loop] [/loop] [/-pass] [/pass]
Forum: Plugins
In reply to: [Custom Content Shortcode] Loop if an ACF flexible field is not emptyFor example, this is what’s required:
DAMAGES POST_1 Damages Flexible Content POST_2 Damages Flexible Content POST_3 Damages Flexible Content ______________________ ADMISSIBILITY POST_1 Admissibility Flexible Content POST_2 Admissibility Flexible Content POST_3 Admissibility Flexible Content
There are tens of ACF Flexible Content fields for a post, some are empty, some are not.
I guess I can add every ACF Flexible Content Field through if clauses inside
the-loop
, however I couldn’t figure out how to hide the title when there field is empty and isn’t displayed.Forum: Plugins
In reply to: [Custom Content Shortcode] Loop if an ACF flexible field is not empty@polarracing thanks for your answer. You’ve been very helpful as always.
The following code worked, with a caveat:
[pass global=route] [loop exists type=case taxonomy=arbitrator term='{FIELD_2}'] DAMAGES<br> [the-loop] [if field="damages"] [field title-link] [flex damages] [layout fet-text] <p class="single_acf_text">[field fet-text]</p> [/layout] [layout fet-select] <p class="single_acf_select">[field fet-select]</p> [/layout] [/flex] [/if] [/the-loop] [/loop] [/pass]
This works for one field. However I want to run this code for all of the flexible content fields. I was thinking adding the same code with different fields, but
[loop exists]
solution means tens of nested loops.Could you please think of any other way?
For the record, this is how I managed it:
[pass list='A'] [for each=custom_taxonomy] [set test][each name][/set] [if var=test start='{ITEM}'] <ul class="my_class"><li class="my_class">[each link]<span class="my_class_count">[loop-count type=custom_post_type taxonomy=custom_taxonomy]</span></li></ul> [/if] [/for] [/pass]
One more thing:
How to convert the taxonomy names into taxonomy links?
I’ve tried:
[pass list='A'] [for each=custom_taxonomy] [set test][each name][/set] [if var=test start='{ITEM}'] <a href="[url]/custom_taxonomy/[get test]">[each name]</a> [/if] [/for] [/pass]
However, this doesn’t recognize the
[get test]
. It only directs to : https://www.mysite.com/custom_taxonomyPerfect! Thanks for your informative answer.
@polarracing , thank you for taking the time and answering my question.
The above code did not work. It lists all the taxonomy terms.
About setting variables with
[each name]
, could you please elaborate your answer? I did not get it.Thanks.
Forum: Plugins
In reply to: [Custom Content Shortcode] Display page numbers in a drop-down listThanks for your guidance. If anyone comes across this issue, I used
parameter=true
and then used the following JQuery code to convert theul li
tags created by the CCS into a drop-down list:jQuery(document).ready(function($) { $('ul.pagination').each(function() { var list = $(this), select = $(document.createElement('select')).insertBefore($(this).hide()).change(function() { window.open($(this).val(), '_self') }); $('> li a, > li span', this).each(function() { var option = $(document.createElement('option')) .appendTo(select) .val(this.href) .html($(this).html()); if ($(this).hasClass('current')) { option.attr('selected', 'selected'); } }); list.remove(); }); });
- This reply was modified 3 years, 10 months ago by mehmetba.
Forum: Plugins
In reply to: [Custom Content Shortcode] How to use “start” parameter?[loop type=post field=title start=A] [field title] [/loop]
This worked. Many thanks.