Minesh
Supporter
Sprachen:
Englisch (English )
Zeitzone:
Asia/Kolkata (GMT+05:30)
I have set the next reply to private which means only you and I have access to it.
Minesh
Supporter
Sprachen:
Englisch (English )
Zeitzone:
Asia/Kolkata (GMT+05:30)
Yes - this works but can you please share problem URL where you added the view and what view I need to work with. Just wanted to double check.
Yes.
The views are:
1. Stichwoerter Alpabetical First View
2. Stichwoerter Alpabetical Second View
The view is displayed on:
versteckter Link
I think the view has to be different from the approach we took here, because like on the site versteckter Link it has to be a view for the alphabetical letters (maybe as a grid?) and if you click on a letter, the tags should appear for that letter (like on versteckter Link).
Minesh
Supporter
Sprachen:
Englisch (English )
Zeitzone:
Asia/Kolkata (GMT+05:30)
Ok - I've added the following code to Toolset's custom code section:
=> versteckter Link
function func_filter_by_char_caluse( $clauses, $taxonomies, $args ) {
if ( ! empty( $args['term_char'] ) ) {
global $wpdb;
$char_like = $wpdb->esc_like( $args['term_char'] );
if ( ! isset( $clauses['where'] ) )
$clauses['where'] = '1=1';
$clauses['where'] .= $wpdb->prepare( " AND t.name LIKE %s", "$char_like%");
}
return $clauses;
}
add_filter( 'terms_clauses', 'func_filter_by_char_caluse', 10, 3 );
add_filter( 'wpv_filter_taxonomy_query', 'func_filter_taxview_by_char', 10, 3 );
function func_filter_taxview_by_char($tax_query_settings, $view_settings, $view_id){
if($view_id == 1591){
$res = get_terms( 'post_tag', 'term_char='.$_GET['terms-filter'] );
$ids = array();
foreach($res as $k=>$v):
$ids[] = $v->term_id;
endforeach;
$tax_query_settings['include'] = join(",",$ids);
}
return $tax_query_settings;
}
Now, if you check the page and click on any character you will find the tag names which will start from that selected character:
=> versteckter Link
Thank you very much!
So, the views are not neccessary? I think, the solution you did with custom PHP code is not doable through (nested) views?
How can I link from a tag to the related article? For example if you click on one of the tags, that it opens the related article?
Minesh
Supporter
Sprachen:
Englisch (English )
Zeitzone:
Asia/Kolkata (GMT+05:30)
So, the views are not neccessary? I think, the solution you did with custom PHP code is not doable through (nested) views?
==> Well - if you see, we are still using nested views, so it requires nested view + the code to filter the tag names with specified character:
- versteckter Link
(As you noticed we added a view that displays the alphabets and loop editor section displays the tag title)
How can I link from a tag to the related article? For example if you click on one of the tags, that it opens the related article?
=> I just changed the
[wpv-taxonomy-title]
To
[wpv-taxonomy-link]
and now it will open the tag archive.
Thanks a lot.
Now I want to display the tags only, if you click on one of the letters and not if you click on the page and haven't clicked on one of the letters yet. I tried this solution: https://toolset.com/forums/topic/if-wpv-post-param-has-a-specific-var-then/
and replaced it like
[wpv-conditional if="( '[wpv-search-term param="term-filter"]' ne '' )"]
<div>[wpv-taxonomy-link]</div>
[/wpv-conditional]
but this doesn't work.
Minesh
Supporter
Sprachen:
Englisch (English )
Zeitzone:
Asia/Kolkata (GMT+05:30)
Well - sir that is another problem.
I split the ticket here. Please resolve this and we will continue with the split ticket. This will help other users searching on the forum as well as help us to write correct problem resolution summary that belongs to the orignial issue.
My issue is resolved now. Thank you!