Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
are there examples for keywords-/tags-using - with different plugins?
#1
hi,

is there any supporting example-site, that demonstrate, how to use keywords in a consistent way?


on getsimple sites, I get tags with get_page_meta_keywords(); , but without beeing linked. Here in the template.php
PHP Code:
if (function_exists('get_page_meta_keywords')) {
 
   ob_start();
 
   get_page_meta_keywords();
 
   $keywords ob_get_clean();
 
   if ($keywords    {
 
       echo "<!-- keywords -->
        <p class="
p-tags">Themen: <span class=\"keywords\" title=\"tags\">";
 
       echo $keywords."</span></p>\n"; } 
Links are only given in the tag-cloud? I think so?

The newsmanager-PlugIn delivers tags with links and add them to the GS tag-cloud, but if you link on a newsmanager-article-tag, it is just showing up its own article and doesn't include GS-pages with the same tag.

Tags of the I18N-gallery seems to be only provided for filtering images? They are not shown in the GS tag-cloud nor with the images?


So it would be nice, if tags are more usable for navigation.
Are there any help or know-hows?

bell
Reply
#2
3.4 will have some built in tags handling methods, but as of now there is not really much besides custom code to utilize it
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#3
(2017-10-15, 00:45:24)shawn_a Wrote: 3.4 will have some built in tags handling methods,...

thanx! I'll be tight and wait.

So now I've to take the keyword-array in pieces and implement links by php?

bell
Reply
#4
I18N Search can be used to do stuff like that.
Reply
#5
yes, thanx, I18N Search for the tagcloud,
but for the articles tags
admin/inc/theme_functions.php z66
gives *Page Meta Keywords*, the tags for articles, as
SimpleXMLExtended Object ( [0] => tag1, tag2, tag3 )

best will be for me still a template-update of the $keyword-array

best, bell
Reply
#6
You don't need to do that ob_start etc. You can do this instead:
PHP Code:
$keywords get_page_meta_keywords(false); 

For an array of tags you can do something like:
PHP Code:
$keywords get_page_meta_keywords(false);
$keywords_array array_map('trim'explode(',',$keywords)); 
Reply
#7
> You don't need to do that ob_start
I had the problem, that the output of the function was printed to early ...
what means the "false" - see, I've some php-voids ...


Thank you! Now its running - for the template-file I made this:
PHP Code:
if (function_exists('get_page_meta_keywords')) {
 
$keywords get_page_meta_keywords(false);
 if (
$keywords)     {
    echo 
"<!-- keywords -->
    <p class=\"tags\">Marker: \n"
;            
    
$keywords_array array_map('trim'explode(',',$keywords));    
 
        $nextRow FALSE 
         $i 
0;
 
       while ($i count($keywords_array))    {        
 
            if ($nextRow) {  print ", \n"; }    // a spacer
 
            $nextRow TRUE;
 
            $v sprintf(strtr($keywords_array[$i], " ""_"));
    echo 
"<a href=\""; echo get_site_url(); echo "index.php?id=search&tags=".strtolower($v)."\" class=\"tag\">".strtr($v"_"" ")."</a>"                          
                $i
++;
                    } 
                
    
echo "\n</p>\n";                             
        }
                            } 

best, bell
Reply
#8
Many GS template tags/functions display stuff by default, but return it without echoing if you pass false as a parameter.
See http://get-simple.info/wiki/themes:templ..._functions
Reply




Users browsing this thread: 1 Guest(s)