|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
alihassan Smarty n00b
Joined: 30 Apr 2016 Posts: 3
|
Posted: Sat Apr 30, 2016 9:50 am Post subject: How to add realted posts in smarty php |
|
|
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 |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Sat Apr 30, 2016 12:23 pm Post subject: |
|
|
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 |
|
alihassan Smarty n00b
Joined: 30 Apr 2016 Posts: 3
|
Posted: Mon May 02, 2016 7:07 am Post subject: |
|
|
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 |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Mon May 02, 2016 12:38 pm Post subject: |
|
|
What code? I have no idea, what you are considering "related posts". |
|
Back to top |
|
elpmis Smarty Elite
Joined: 07 Jun 2007 Posts: 321
|
Posted: Tue May 03, 2016 8:03 pm Post subject: |
|
|
@alihassan
Which Smarty related software do you are using? |
|
Back to top |
|
alihassan Smarty n00b
Joined: 30 Apr 2016 Posts: 3
|
Posted: Thu May 05, 2016 8:29 am Post subject: |
|
|
elpmis wrote: | @alihassan
Which Smarty related software do you are using? |
I am using smart job board. |
|
Back to top |
|
elpmis Smarty Elite
Joined: 07 Jun 2007 Posts: 321
|
Posted: Sat May 07, 2016 8:04 am Post subject: |
|
|
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 |
|
|
|
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
|