Okay
  Public Ticket #808669
Tag cloud and site search problem
Closed

Comments

  • Norbert started the conversation

    Hi, 

    I have a problem with the theme. Now that my blog has more content I noticed that the search is not working for the whole content just for the most recent posts and the same with the tag cloud, the tag cloud is populated only with the tags from the most recent posts, while the tags from older posts are not appearing.

  •  2
    Estudio replied

    Hi!,

    I did a deep check inside these functionalities, and i updated all symetric features to work with the latest Ghost API.

    When Themeforest approves this update, you will see 2 symmetric theme (ghost-symmetric.zip v2) and (ghost-symmetri-1.5-legacy.zip)

    On Symmetric v2.0 all these problems will be resolved.

    Best Regards!

  • Norbert replied

    Thank you for the quick reply.

    Can you tell me where did you change the theme, or what exacly? because there was made a lot of customization, I have to change only the parts that are needed for the seach and tag cloud.

  •  2
    Estudio replied

    Hi! in that case here are the steps:

    1.- Replace assets/js/jquery.ghostHunter.min.js

    2.- Go to assets/js/global.js and remove these lines:

    /* Featured Sections */
            
            if($('aside#featured .featured-top').length > 0){
                $.get("/tag/featured-top", function(data) {
                    $('aside#featured .featured-top .box').html(data);
                });
            }
            if($('aside#featured .featured-bottom').length > 0){        
                $.get("/tag/featured-bottom", function(data) {
                    $('aside#featured .featured-bottom .box').html(data);
                });
            }
    /* Sidebar */
            
            if($('.widget_tag_cloud .feed').length > 0){
                $.get("/rss/", function(data) {
                    var $xml = $(data);
                    var tags = '';
                    var tags_array = [];
                    tags += '<div class="tagcloud">';
                    $xml.find("category").each(function() {
                        var tag = $(this).text();
                        if ($.inArray(tag, tags_array) == -1) {
                            tags_array.push(tag);
                        }
                    });
            
                    tags_array = jQuery.unique(tags_array);
            
                    for (var i = 0; i < tags_array.length; i = i + 1) {
                        var tag = tags_array[i];
                        var tagURL = tag.toLowerCase().replace(/ /g,"-");
                        if(tag != 'standard' && tag != 'example' && tag != 'carousel' && tag != 'link' && tag != 'quote')
                            tags += '<a href="/tag/'+tagURL+'/">' + tag + '</a>';
                    };
            
                    tags += '</div>';
                    $('.widget_tag_cloud .feed').html(tags);
                });
            }
    

    3.- Cloudtag: Open partials/sidebar-default.hbs and edit:

    <!-- start: .widget_tag_cloud -->
        <section class="widget widget_tag_cloud">
            <h4 class="widget-title title bordered">Tag Cloud</h4>
            <div class="feed"></div>
            <div class="clear"></div>
        </section>
        <!-- end: .widget_tag_cloud -->
    

    With this:

    <!-- start: .widget_tag_cloud -->
        <section class="widget widget_tag_cloud">
            <h4 class="widget-title title bordered">Tag Cloud</h4>
            <div class="feed">{{#get "tags" limit="all"}}{{tags separator=""}}{{/get}}</div>
            <div class="clear"></div>
        </section>
        <!-- end: .widget_tag_cloud -->
    

    4.- Featured sections: Open partials/sidebar-featured.hbs and edit:

    <!-- start: .item -->
        <div class="item featured-top">
            <h3 class="title bordered">TECHNOLOGY</h3>
            <div class="box">
                
            </div>
        </div>
        <!-- end: .item -->
        
        <!-- start: .item -->
        <div class="item featured-bottom">
            <h3 class="title bordered">NATURE</h3>
            <div class="box">
                
            </div>
        </div>
        <!-- end: .item -->
    

    With this:

    <!-- start: .item -->
        <div class="item featured-top">
            <h3 class="title bordered">TECHNOLOGY</h3>
            <div class="box">
                {{#get "posts" limit="7" filter="tags:featured-top" as |featured-top|}}
                    {{#foreach featured-top}}
                        <article class="{{post_class}}">
                            <time class="uppercase" datetime="{{date format='YYYY-MM-DD'}}"> {{date}}</time>
                            <h4 class="title"><a href="{{url}}">{{title}}</a></h4>
                        </article>    
                    {{/foreach}}
                {{/get}}
            </div>
        </div>
        <!-- end: .item -->
        
        <!-- start: .item -->
        <div class="item featured-bottom">
            <h3 class="title bordered">NATURE</h3>
            <div class="box">
                {{#get "posts" limit="7" filter="tags:featured-bottom" as |featured-bottom|}}
                    {{#foreach featured-bottom}}
                        <article class="{{post_class}}">
                            <time class="uppercase" datetime="{{date format='YYYY-MM-DD'}}"> {{date}}</time>
                            <h4 class="title"><a href="{{url}}">{{title}}</a></h4>
                        </article>    
                    {{/foreach}}
                {{/get}}
            </div>
        </div>
        <!-- end: .item -->
    

    5.- Go to your ghost admin/settings -> labs and check Public Api, if you have some kind of error, you must go back to symmetric 1.5

    In summary, these lines do all the work:

    {{#get "tags" limit="all"}}{{tags separator=""}}{{/get}}
    {{#get "posts" limit="7" filter="tags:featured-bottom" as |featured-bottom|}}
                    {{#foreach featured-bottom}}
                        <article class="{{post_class}}">
                            <time class="uppercase" datetime="{{date format='YYYY-MM-DD'}}"> {{date}}</time>
                            <h4 class="title"><a href="{{url}}">{{title}}</a></h4>
                        </article>    
                    {{/foreach}}
                {{/get}}

    Hope this may help you, and don't forget to rate our template it is always help.

  • Norbert replied

    Perfect, worked like a charm.

    Thank you very much, I rated the template. 5 star of course :)