eSyndiCat User Forums esyndicat directory software esyndicat support

Go Back   eSyndiCat User Forums > eSyndiCat Directory Software [FREE] > User interface > Existing Templates

Existing Templates Want to adjust logo or center some piece of text in your directory? Get advice on how to do it in this forum dedicated to pre-installed templates.

Reply
 
Thread Tools Display Modes
Old 09-15-2008   #1
spuby
 
Join Date: Sep 2008
Posts: 5
spuby is on a distinguished road
Default New listings show on homepag

Hi,
I've just started playing with omega (esyndicat v 1.6) and I'm using the Glassy template. I've looked through the forums but cannot find how to:
- add the latest 4/5 new listings to the homepage so that they're shown under the categories.

Could someone please let me know how I could achieve this? Thank you.
spuby is offline   Reply With Quote
Old 09-16-2008   #2
Nikita B.
Guest
 
Posts: n/a
Default

Hi spuby and welcome to our forum!

Please apply directives:

Open index.php file
Find code:
Code:
$gDirSmarty->assign_by_ref('listings', $listings);
ADD code before
Code:
$new_listings = $Listing->getLatest( 0,5 );
$c = count($new_listings);
for($i=0; $i < $c; $i++)
{
	if(!empty($new_listings[$i]['path']))
	{
		$new_listings[$i]['path'] .= '/';
	}
}
$gDirSmarty->assign('new_listings', $new_listings);
WHERE '5' number of new listings in this block.

Then open templates/Your_template/index.tpl file

Find categories code there
Code:
{if $categories}
	{include file="box-header.tpl" caption=$lang.categories}
		{$categories}
	{include file="box-footer.tpl"}
{/if}
After add

Code:
{if $new_listings}
	{include file="box-header.tpl" caption=$lang.new_listings}
		<div class="listings">
			<table cellspacing="0" cellpadding="0">
			{foreach from=$new_listings item=listing}
				{include file="listing-display.tpl"}						
			{/foreach}
			</table>
		</div>
	{include file="box-footer.tpl"}
{/if}
  Reply With Quote
Old 09-16-2008   #3
spuby
 
Join Date: Sep 2008
Posts: 5
spuby is on a distinguished road
Default

Thank you! This worked perfectly.
spuby is offline   Reply With Quote
Old 09-16-2008   #4
spuby
 
Join Date: Sep 2008
Posts: 5
spuby is on a distinguished road
Default

Hi,
Actually I spoke too soon. Now the New listings show on the maing page correctly, but the link for Listing Details gives a 404. I use mod_rewrite so the url should be categorypath/title-something.html, instead on the homepage is categorypathtitle-something.html (the / is missing). Do you have any ideas how I could correct this?

Thank you.
spuby is offline   Reply With Quote
Old 09-17-2008   #5
Nikita B.
Guest
 
Posts: n/a
Default

Add
Code:
$c = count($new_listings);
for($i=0; $i < $c; $i++)
{
	if(!empty($new_listings[$i]['path']))
	{
		$new_listings[$i]['path'] .= '/';
	}
}
After
Code:
$new_listings = $Listing->getLatest( 0,5 );
I have edited my previous post also.
  Reply With Quote
Old 09-17-2008   #6
spuby
 
Join Date: Sep 2008
Posts: 5
spuby is on a distinguished road
Default

Hi,
Thank you, that worked and the link is correct now. However, it seems that now the New Listings section shows on every category page too, can it be shown only on the main page?

Sorry for troubling you that much.
spuby is offline   Reply With Quote
Old 09-18-2008   #7
Vladimir T.
 
Join Date: Nov 2007
Location: Earth
Posts: 973
Vladimir T. is on a distinguished road
Default

Hi,

Quote:
Originally Posted by spuby View Post
Hi,
can it be shown only on the main page?
You should edit index.tpl.

Code:
{$category.id eq 0}
{if $new_listings}
	{include file="box-header.tpl" caption=$lang.new_listings}
		<div class="listings">
			<table cellspacing="0" cellpadding="0">
			{foreach from=$new_listings item=listing}
				{include file="listing-display.tpl"}						
			{/foreach}
			</table>
		</div>
	{include file="box-footer.tpl"}
{/if}
{if}
Vladimir T. is offline   Reply With Quote
Old 09-18-2008   #8
spuby
 
Join Date: Sep 2008
Posts: 5
spuby is on a distinguished road
Default

This time it all worked. Thank you.

P.S. Actually in your code there should be a starting {if} for the category match, but I figured it out. Thanks.
spuby is offline   Reply With Quote
Old 09-24-2008   #9
Vladimir T.
 
Join Date: Nov 2007
Location: Earth
Posts: 973
Vladimir T. is on a distinguished road
Default

You a welcome.
Vladimir T. is offline   Reply With Quote
Old 06-06-2010   #10
dtp3
 
Join Date: May 2010
Posts: 2
dtp3 is on a distinguished road
Default

Omega 1.6 - when I use this code page is blank , what is wrong ?
dtp3 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 04:17 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Testimonials | Articles | Support | Documentation | Privacy Policy | License | Affiliates | Contact Us | SEO Resources