News: TinyPortal Release Schedule. Please read this update for More Info.

Login  |  Register
HTML5 Icon HTML5 Icon
TP on Social Media
Welcome, Guest. Please login or register.
Did you miss your activation email?

June 24, 2019, 05:25:07 AM

Login with username, password and session length

Recent

Members
Stats
  • Total Posts: 188454
  • Total Topics: 20728
  • Online Today: 39
  • Online Ever: 629
  • (November 08, 2018, 01:36:54 PM)
Users Online
Users: 0
Guests: 17
Total: 17

Author Topic: ARTICLE CATEGORIE BOX  (Read 5428 times)

0 Members and 1 Guest are viewing this topic.

Offline vincitygialam

  • Newbie
  • *
  • Posts: 1
ARTICLE CATEGORIE BOX
« on: October 23, 2018, 05:49:11 PM »
Is there any ready to use box that I can add to a tinyportal panel where I have a list of all existing categories for articles and if I click a categorie I get only the fitting articles?  Like in a blog.

Offline lurkalot

  • Administrator
  • *
  • Posts: 6053
    • Camera Craniums
Re: ARTICLE CATEGORIE BOX
« Reply #1 on: October 24, 2018, 03:13:20 PM »
Sorry for delay in replying.

Pretty sure there isn't a block available to do this, but I'll have a check around and see if there's a workaround you could use for this purpose.

Offline @rjen

  • Support Team
  • *
  • Posts: 1678
    • FJR-club Nederland
Re: ARTICLE CATEGORIE BOX
« Reply #2 on: October 24, 2018, 03:24:08 PM »
It should be possible to create that in a php block...
Running TP1.6.3 on SMF2.0 at: www.fjr-club.nl

Testing TP on SMF2.0
Testing TP on SMF2.1 RC2
Want to check what php version I am testing on? See: PHP Info

Offline wildenborch

  • Support Team
  • *
  • Posts: 342
Re: ARTICLE CATEGORIE BOX
« Reply #3 on: October 24, 2018, 11:07:44 PM »
This can also be done with the menu manager.
Or do I misunderstand your question?
Do you want to show the articles or only the article titles?
« Last Edit: October 24, 2018, 11:55:51 PM by wildenborch »

Offline @rjen

  • Support Team
  • *
  • Posts: 1678
    • FJR-club Nederland
Re: ARTICLE CATEGORIE BOX
« Reply #4 on: October 25, 2018, 03:59:23 AM »
You can try this code in a PHP block...

It will build a list of all categories, and clicking the category will bring you to the category page, showing all articles in the category.

The category page will show in the layout type as you defined it in the settings for the category...

Code: [Select]
echo ' <div style="float:left;padding-right: 5px;"><img height="35px" src="Themes/default/images/tinyportal/TPov_categories.png"></img></div><strong>Categories</strong></br>' ;
echo ' <br>' ;
echo ' <hr>' ;

global $scripturl, $smcFunc;

$request = $smcFunc['db_query']('', '
     SELECT id, value1, type
     FROM {db_prefix}tp_variables
     WHERE type = "category"
     ORDER BY value1 ASC'
);
echo '
<ul style="list-style-type:disc; margin: 0pt; padding: 0pt 15px;">
 ';
while ($row = $smcFunc['db_fetch_assoc']($request))
{
     echo '<li><a href="', $scripturl, '?cat=', $row['id'], '">', $row['value1'], '</a></li>';
}
echo '</ul>';
$smcFunc['db_free_result']($request);
Running TP1.6.3 on SMF2.0 at: www.fjr-club.nl

Testing TP on SMF2.0
Testing TP on SMF2.1 RC2
Want to check what php version I am testing on? See: PHP Info