* wkwk how to get full url on xtblog twig code , example :
i create a post with title "wawawa saya kencot wa"

but in url just show "/__xtblog_entry/10668911-wawawa-saya"

how to get full url /__xtblog_entry/10668911-wawawa-saya-kencot-wa
2015-07-18 01:01 (edited 2015-07-18 03:38 by wkwk ) · (0)
* Graham * wkwk <xt:canonical_uri />
This ONLY returns output when
A forum is on the page (broken if no category or forum post is open)
A blog POST is open
This function is not available in xtscript
2015-07-18 03:17 · (0)
* wkwk * Graham i use xtblog.twig
2015-07-18 03:37 · (0)
* Graham * wkwk it is stored as a part of the data array how you get the url depends on the context
I Have no idea why your url is truncated
my tests have no problem
2015-07-18 08:15 (edited 2015-07-18 08:35 by Graham ) · (0)
* AH-SID * wkwk As long as I know, it happened when we use mobile phone, but when we use touch phone or PC the url is full.

You can use trick meta refresh in {% block entry_post %} by get url blog by javascript and get url blog by twig. Like here:

<script>
var urlbyjs = location.href;
var urlbytwig = '{{ data.post.url }}';
if (urlbyjs != urlbytwig) {
document.write(
'<meta http-equiv="refresh" content="0; url='+urlbytwig+'">'
);
}
</script>

Copy code


You can modify it just like you want..
2015-07-19 18:37 · (0)
* Rare Use this script,
<script>
/* Getting URL of page
*/
var d = document;
d.getElementById('u').innerHTML = d.URL;
</script>
<div id="u"></div>
2016-02-23 19:08 · (0)

Online: Guests: 1