* Inu * Graham Graham Okay I've managed ,, and I want to ask again TWIG code to display in version MOBILE and PC (desktop) Is this code {% if data.device == 'mobile' %} is true for mobile display and to display the PC (desktop) how?
2015-03-26 15:46 · (0)
* Graham * Inu where I add the 32 that is the offset from the start of the needle (in chars) to the start of the content so you will need to adjust that also
The needle what ever you use
must not appear before the start of the post so if it is a common class the script may break
2015-03-26 15:28 (edited 2015-03-26 15:31 by Graham ) · (0)
* Inu * Graham xt_blog_content xt_text normal
whether this should be in the dressing my class because I had to replace the class d TWIG
2015-03-26 15:01
*
* UC Super MOD V5-7-01-43.png · image/png · 13.46KB
· (0)
* Graham * Inu I have changed the code below
open a post
It now takes the contents of the post up to the first </div>
It then passes it through striptags and uses the result in the description meta tag
This is based on standard twig on a version 2 blog with html enabled in the post
the demo includes a variable dump at thebottom of the page
http://newblogtest.yn.lt/blog
2015-03-26 14:44 (edited 2015-03-26 14:59 by Graham ) · (0)
* Inu * Graham Xtscript you give do not succeed ... Demo http://streetfilm.sextg em.com/view/
2015-03-26 10:31
* * *
* UC Super MOD V5-2-30-04.png · image/png · 14.78KB
* UC Super MOD V5-2-30-14.png · image/png · 14.51KB
* UC Super MOD V5-2-30-28.png · image/png · 15.67KB
· (0)
* Graham * Inu This is a complete page code
It now takes the contents of the post up to the first </div>
You can still use the blog on the page from the building tool just be careful of the other lines
disable any other description meta tag the new tag is inserted by {_$$meta|}
<!DOCTYPE html>
<html>
<head>
  {_$$meta|}
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width,initial-scale=1" />
  <title>x</title>
</head>
<body>
    <div data-xtcontainer="container" class="xt_container"><xt:code><!--parser:xtscript-->
    # </xt:code>
  var $blog=<xt:blog tzone="0" format="Y-m-d" display="1" show_time="0" entries_per_page="3" comments_per_page="20" comments_sort="-1" entries_sort="-1" display_limit="0" 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="" />
    # <xt:code>
      var $start_post_content = call strpos $haystack=$blog;$needle=xt_blog_content xt_text normal
      if $start_post_content >0
      var $start_post_content =($start_post_content+32)
      var $end_post_content = call strpos $haystack=$blog;$needle=</div>;$offset=$start_post_content
      var $post_content = call substr $val=$blog;$start=$start_post_content;$length=($end_post_content-$start_post_content)
      var $cleaned_post_content=call strip_tags $val=$post_content
      var $meta=<meta name="description" content="$cleaned_post_content" />
      endif

    print $blog
    del $blog
assign $dump=call dump_vars
assign $dump=call trim $val=$dump ; $charlist={{<pre>
Array/ }}
assign $dump=call trim $val=$dump ; $charlist=( )
assign $dump=call htmlspecialchars $val=$dump
assign $dump=call nl2br $val=$dump
print $dump<br/>
    <!--/parser:xtscript--></xt:code>
    </div>
</body>
</html>

Copy code
2015-03-26 06:11 (edited 2015-03-26 14:55 by Graham ) · (0)
* Inu * Graham yes meta tag .. set to _headertags part .... It may show the code ..
2015-03-26 04:59
*
* UC Super MOD V5-20-59-56.png · image/png · 14.4KB
· (0)
* Graham * Inu Which meta tags ? and set to which part of the posts content?
It needs to use xtscript
2015-03-26 02:21 (edited 2015-03-26 02:22 by Graham ) · (0)
* Inu * TechnoSparks Thanks bro .. Already explain :)
2015-03-25 16:57 · (0)
* Inu * Graham thanks graham, and how to set the <meta name = automatically on every post in xtblog ....?
2015-03-25 16:54 · (0)

Online: Guests: 1