* alizainal.aljufri Help me Mr. Graham, I want to change url xtblog from http://domain.xtgem.com/index/__xtblog_entry/10265597/cara-membuat-url-posting-xtblog-tanpa-query.html?__xtblog_block_id=1 to http://domain.xtgem.com/posts/__xtblog_entry/10265597/cara-membuat-url-posting-xtblog-tanpa-query.html?__xtblog_block_id=1.
I use this code
{% set url = '/p/__xtblog_entry/'~data.post.url|split('?')|first|split('/__xtblog_entry/')|last~'?__xtblog_block_id=1' %}
Copy code
but eror. So, help me please!
2016-07-18 04:55 · (0)
* RoSino18k "posts" is file HTML
2016-07-18 13:29 · (0)
* AH-SID * alizainal.aljufri
{% set id = data.post.url|split('/__xtblog_entry/')|last|split('-')|first %}
{% set url = 'http://your.xtgem.com/p/__xtblog_entry/'~data.post.url|split('?')|first|split('/__xtblog_entry/')|last|replace({(id~'-'):(id~'/')})~'.html?__xtblog_block_id=1' %}

Copy code


The code above is for view == 'entry'

For view == 'entries_list':

Just use the same code, than change data.post.url into entry.url

Than use it in html anchor link: <a href="{{url}}">{{entry.title}}</a>

note:
you can edit your xtblog's url like that but you have to know that url xtblog in rss feed and link canonical can not be changed

That all.
2016-07-18 17:35 · (0)
* alizainal.aljufri * AH-SID Thanks for your help. It's success but related post is eror! Check now http://alizainaljufri.jw.lt
2016-07-18 21:10 (edited 2016-07-18 21:39 by alizainal.aljufri ) · (0)
* AH-SID * alizainal.aljufri Hm..
Did you use this code?

<xt:code><!--parser:xtscript-->
#</xt:code>
var $xtblog=<xt:blog tzone="7" format="d-m-y" show_time="1" display="5" entries_per_page="10" comments_per_page="20" comments_sort="-1" display_limit="150" display_symbol="[...]" version="2" t_back_to_posts="" t_comments="" t_comments_empty="" t_post_a_comment="" t_name="" t_comment="" t_post="" t_tags="" t_search="" t_created="" t_showing_tagged_posts="" t_no_entries_found="" t_no_search_results_found="" t_show_all_comments="" t_see_parent_thread="" t_show_all_replies="" t_show_replies="" t_reply="" t_posting_as="" t_comments_login_required="" t_login="" t_signup="" t_confirm_email="" t_report_spam="" t_hidden_comment="" />
#<xt:code>
call str_replace $subject=$xtblog;$search=::func::;$replace=<xt:;
<!--/parser:xtscript--></xt:code>

Copy code
2016-07-18 22:34 · (0)
* alizainal.aljufri * AH-SID Yes, right. I get the code from your site.
2016-07-19 03:31 · (0)
* alizainal.aljufri Ok sorry Ahmad. I found some eror code in twig. But thank you very much for your help. :) :D
2016-07-19 03:55 · (0)
* AH-SID * alizainal.aljufri Because you changed your xtblog url in entries list, so you have to edit xtblog url in related post widget too.

Use same code at file related.twig inside {% set temp %}

replace for set data.post.url into related.url and then change {{related.url}} into {{url}}
2016-07-19 15:20 · (0)
* Devian * AH-SID i was used your trick about adding related posts but doesn't work bro...
But while I read sir Graham tricks it's works, whats wrong with your trick ?
2017-02-11 04:37 · (0)

Online: Guests: 1