Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

How to add realted posts in smarty php

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
alihassan
Smarty n00b


Joined: 30 Apr 2016
Posts: 3

PostPosted: Sat Apr 30, 2016 9:50 am    Post subject: How to add realted posts in smarty php Reply with quote

I want to add related post in each page

related post from category or 6 latest post from that category.

the variable of category is $listing.JobCategory

i want to show related job like this.



Can any one tell me the code to do this.
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Sat Apr 30, 2016 12:23 pm    Post subject: Reply with quote

For that, you need to write a code to select "related" articles from your database and pass them to the template that will render it on a page.
However you define the "relation".


Last edited by AnrDaemon on Mon May 02, 2016 12:39 pm; edited 1 time in total
Back to top
View user's profile Send private message
alihassan
Smarty n00b


Joined: 30 Apr 2016
Posts: 3

PostPosted: Mon May 02, 2016 7:07 am    Post subject: Reply with quote

AnrDaemon wrote:
For that, you need to write a code to select "related" articles from your database and pass ot to the template that will render it on a page.
However you define the "relation".


Can you please tell me the code ?
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Mon May 02, 2016 12:38 pm    Post subject: Reply with quote

What code? I have no idea, what you are considering "related posts".
Back to top
View user's profile Send private message
elpmis
Smarty Elite


Joined: 07 Jun 2007
Posts: 321

PostPosted: Tue May 03, 2016 8:03 pm    Post subject: Reply with quote

@alihassan

Which Smarty related software do you are using?
Back to top
View user's profile Send private message
alihassan
Smarty n00b


Joined: 30 Apr 2016
Posts: 3

PostPosted: Thu May 05, 2016 8:29 am    Post subject: Reply with quote

elpmis wrote:
@alihassan

Which Smarty related software do you are using?


I am using smart job board.
Back to top
View user's profile Send private message
elpmis
Smarty Elite


Joined: 07 Jun 2007
Posts: 321

PostPosted: Sat May 07, 2016 8:04 am    Post subject: Reply with quote

I'm not familiar with that software but I'm sure there's a variable named category (or something) inside Smarty ... you could check it with

Code:

{$smarty->getTemplateVars()}


After knowing that you can modify the job detail template and a new call for related jobs like (attention, it's only pseudo code)

Code:
{jobs category=$var_for_category number='6'}
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP