Recent Topics

1 Jul 15, 2014 03:35    

The post lists widget (_postidx ...) works okay EXCEPT that when you click on any post in the list, it sends you to the site that you linked to in the post (if a main link was included), not to the permalink of the post itself. If no link was included in the post, it correctly sends you to the permalink of the post. How can I get it to always link to the permalink of the post itself?

2 Jul 16, 2014 20:12

Hello @tonyquain,

The widget that you mentioned is based on this other: http://b2evolution.net/man/universal-item-list-widget-1, and the parameter that you need to change is Link titles. In this case, the default value is auto, which means that when a URL has been defined in the item, it will link there. The value that you want is permalink, this way each entry in the list will behave exactly as you need to.

Sadly the post_list_Widget is not ready to override the default values of its parent widget directly in the back-office, so you will need to make a little hack to its code. In this case:

1. Go to the file blogs/inc/widgets/widgets/_coll_post_list.widget.php.
2. Locate the line:

$r['item_title_link_type']['no_edit'] = true;


3. Add the following line below:

$r['item_title_link_type']['defaultvalue'] = 'permalink';

NOTE: you didn't mention what version of b2evolution are you running, so this instructions have been tested in v5.0.9.

Regards!

3 Jul 16, 2014 20:17

@tonyquain it's me again :D

Regarding my comment above, please do not replace the line mentioned in the step 2, just add the line in step 3 right below.

4 Jul 16, 2014 20:30

Thanks so much, mgsolipa!
I'll try that. Running 5.0.8, so shouldn't be a problem.

5 Mar 04, 2016 21:31

Just to make things clear: you don't need to edit any code: just use the //Universal Item List widget// instead of the //Simple Post Lists widget//.


Form is loading...