Recent Topics

1 Jul 27, 2014 14:26    

Hi friends,
i try to customize my b2evolution skin and for that i try to use variables from the system.
i got problem with 2 variables
$Item->tags
$Item->categories
when i try to use tham and put in my code
'.$Item->categories().'
what i get is the ready link of the categories like they on the system and i cant customize that for my skin
i can put it in place that i got for this
i need to get it in clean HTML without the system settings
how can i get it?
example:
when i put in my skin:
echo'<div id="tags">'.$Item->tags.'</div>;'
i got the tags list but with system setting and it go up to the top in the page
help?

2 Jul 27, 2014 16:46

@denis012,

1. What's the skin are you using, is this custom or from the community skins page?
2. in customizing the location of the code, please make sure to place the code accordingly in the skin you use,( which we don't have any clue yet, answer #1 first)
3. <div id="tags"> , this indicates the location of the tags, go to the css file of your skin folder and look for #tags and change the properties of it to fit your needs.

Thanks!

3 Jul 27, 2014 19:32

I use the skin "mystique "
i mean, how in PHP i can get the list of the variable $Item->categories();
how can i remove the hyperlink when i use the $Item->categories(); code so that it is plan text without the hyperlinks in it
to disable all functions around item

thanks

4 Jul 28, 2014 06:59

Hello @denis012,

The most of that kind of methods could be customized according the parameters that you pass them. Those parameters are in an array and you may know which options are available and how can be used, just by going directly to the code of the method that you are using.

For example, in categories() and tags() you may include

'link_categories' => false,

in the parameters array to grab only the name of the element in plain text.

I suggest you to use this PHPXref for further reference: https://github.com/mgsolipa/b2evolution_phpxref. Just make a local copy of the repository and check it whenever you want. Use the Search box at the right top corner to find anything you need.

Regards!

5 Jul 28, 2014 08:44

mgsolipa thanks fdor your comment,
i know that i can use the array and all the parameters but still its dosnt give me a clean output
how can i controll this parameters? i wich file i can edit the parameters for categories() and tags()?

6 Jul 28, 2014 18:47

@denis012 please, check the attached images. The first one is the default behavior of the Mystique skin when it displays the categories list. The second one, shows the modification that you need to do to get rid of the link on each category name. The final result is a plain text list of the categories to which the current item belongs.

In order to repeat the same with the tags, you need to do this:

1 Go to the file skins/mystique/_item_blog.inc.php
2 Look for this block of code:


// List all tags attached to this post:
$Item->tags( array(
	  'before'		=> '<div class="post-tags" title="'.$Skin->T_('Tags').'">',
	  'after'		=> '</div>',
	  'separator'	=> ', ',
  ) );


3 Replace it with:


// List all tags attached to this post:
$Item->tags( array(
	  'before'		=> '<div class="post-tags" title="'.$Skin->T_('Tags').'">',
	  'after'		=> '</div>',
	  'separator'	=> ', ',
	  'links' =>            false,
  ) );


Form is loading...