FlixWatch Support
Forum Replies Created
-
The issue has been resolved.
Forum: Plugins
In reply to: [AMP] json_decode issue with amp-listYep, the triple mustache or triple curly braces works.
Thanks Milind.
Regards
Forum: Plugins
In reply to: [AMP] JSON LD Markup with AMP List/MustacheHi Milind,
Have asked the question in amp-html as per your recommendation.
Here’s the link.
Thanks for the hardwork.
Regards
Forum: Plugins
In reply to: [AMP] json_decode issue with amp-listHi Milind,
Here’s the screenshot – https://www.awesomescreenshot.com/image/10261710?key=bd8e67eaedfe6d306d5f4696bb024974
Regards
Forum: Plugins
In reply to: [AMP] JSON LD Markup with AMP List/MustacheHI Milind,
I tried this with {{position}}:
<div itemscope itemtype="https://schema.org/ItemList"> <span itemprop="name"><?php $title; ?></span> <link itemprop="itemListOrder" href="https://schema.org/ItemListOrderDescending" /> <amp-list height="100" width="auto" load-more="auto" src="https://www.flixwatch.co/stagin/list-schema/?post_id=<?php echo $post->ID; ?>" binding="no"> <template type="amp-mustache"> <div itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"> <meta itemprop="position" content="{{rank}}"/> <div itemprop="url">{{url}}</div> </div> </template> </amp-list> </div>By directly adding code: https://search.google.com/test/rich-results?id=EM6xJ4FA4dR-7DfCzXtk2A
Test with meta position included:
https://search.google.com/test/rich-results?id=lSysHk1EJGDReuSxjJIhxATest without meta position:
https://search.google.com/test/rich-results?id=QDeZov9kJ5R-sIdstr5ogwThe meta property is not getting generated in html.
Forum: Plugins
In reply to: [AMP] JSON LD Markup with AMP List/MustacheNope. Doesn’t work.
<div itemscope itemtype="https://schema.org/ItemList"> <span itemprop="name"><?php $title; ?></span> <br> <link itemprop="itemListOrder" href="https://schema.org/ItemListOrderDescending" /> <amp-list height="100" width="auto" load-more="auto" src="https://www.flixwatch.co/stagin/list-schema/?post_id=<?php echo $post->ID; ?>" binding="no"> <template type="amp-mustache"> <a itemprop="itemListElement" href="{{url}}"><span itemprop="name">{{title}}</span><meta itemprop="position" content="{{#count}}" />{{title}}</a> </template> </ol> </amp-list> </div>Since it’s not visible in the frontend, I think it’s not generating the list.
Forum: Plugins
In reply to: [AMP] JSON LD Markup with AMP List/MustacheThanks, will give it a try and get back to you.
Forum: Plugins
In reply to: [AMP] JSON LD Markup with AMP List/MustacheOr I should generate the complete markup separately and just fetch it using amp-script?
Forum: Developing with WordPress
In reply to: Query the same Taxonomy with different operatorsAh, yes. Thanks Joy!
Forum: Plugins
In reply to: [AMP] sessionStorage/localStorage is not definedThanks Milind.
It’s getting a bit complicated for me to implement. I think I rather make multiple calls.
Regards
Forum: Plugins
In reply to: [AMP] sessionStorage/localStorage is not definedHi Milind,
I am using the hash script but it’s not matching the hash showing in console.
<meta name="amp-script-src" content=" <?php echo amp_generate_script_hash(local-script); ?>//local-script is the id of the script " />Sorry the previous link was working.
Here’s the working link with simple script.- This reply was modified 4 years, 10 months ago by FlixWatch Support. Reason: Link was wrong
Forum: Plugins
In reply to: [AMP] sessionStorage/localStorage is not definedHi Milind,
I have added the script hash in the head. The first script is working fine after adding Access Control Allow Origin: https://playground.amp.dev in the header.
https://playground.amp.dev/?format=websites&_gl=1*vzl8hk*_ga*YW1wLS1mZktJSmdpNUJJcWZQN3BXbmRJaHc.#
You can check this link.
Regarding the sessionStorage, I was trying to replicate this example – https://amp.dev/documentation/examples/components/amp-script/#local-storage which uses localStorage without giving errors.I will try to work on the sessionStorage in the playground and get back to you on this.
Forum: Plugins
In reply to: [AMP] Non-cacheable components/elements in AMPAh, yes. It works perfectly. Thank you Milind.
Forum: Plugins
In reply to: [AMP] Non-cacheable components/elements in AMPHi Milind,
Thanks for the code. I have added the same in the template but it’s not visible on the frontend.
https://www.flixwatch.co/stagin/movies/and-tomorrow-the-entire-world-und-morgen-die-ganze-welt/
https://www.flixwatch.co/stagin/region-data/?post_id=72360<?php $post_id = filter_input( INPUT_GET, 'post_id', FILTER_SANITIZE_NUMBER_INT ); /** * Get Regions * * @param int $post_id * @return json */ function get_region( $post_id ) { $region_list = get_the_terms( $post_id, 'region' ); if ( ! empty( $region_list ) && ! is_wp_error( $region_list ) ) : $region_array = array(); $x = 0; foreach ( $region_list as $term_single ) : $region_array[ $x ]['title'] = $term_single->name; $region_array[ $x ]['url'] = get_term_link( $term_single->slug, 'region' ); $x++; endforeach; else : $region_array['items'] = array( 'Not Streaming' ); endif; var_dump(wp_json_encode( array( 'items' => $region_array ) )); return wp_json_encode( array( 'items' => $region_array ) ); } if ( ! empty( $post_id ) ) { get_region( $post_id ); } ?><amp-list width="auto" height="100" layout="fixed-height" src="https://www.flixwatch.co/stagin/region-data/?post_id=<?php echo $post->ID; ?>" > <template type="amp-mustache"> <div class="url-entry"> <a href="{{url}}">{{title}}</a> </div> </template> </amp-list>Forum: Plugins
In reply to: [AMP] Non-cacheable components/elements in AMPThe script I am using to send the data:
<?php $post_id = $_GET['post_id']; function get_region($post_id){ $region_list = get_the_terms($post_id, 'region'); if ($region_list != FALSE) : $region_array = []; $x = 0; foreach($region_list as $term_single) : $region_array[$x][0] = $term_single->name; $region_array[$x][1] = $term_single->slug; $x++; endforeach; else : $region_array = ["Not Streaming"]; endif; echo wp_json_encode($region_array); return (wp_json_encode($region_array)); } if(($post_id)){ get_region($post_id); } ?>