[SOLVED] Strange Company Directory page layout issue

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Post Reply
elkman
Power Poster
Power Poster
Posts: 262
Joined: Thu Jan 11, 2007 9:16 pm
Location: Colorado

[SOLVED] Strange Company Directory page layout issue

Post by elkman »

I have installed the Company Directory and it works well. I have created several categories and subcategories. This worked perfectly.

I have two menu tabs. One showing "Where To Eat" and one showing "Places To Stay". Using the tags: {CompanyDirectory category="Where To Eat"} and {CompanyDirectory category="Places To Stay"} respectively.

I have modified the Summary templates as shown below:

Code: Select all

{if isset($catformstart)}
{$catformstart}
{$catdropdown}{$catbutton}
{$catformend}
{/if}

{if isset($messages)}
<div class="CompanyDirectoryMessage">
 <ul>
   {foreach from=$messages item='one'}
     <li>{$one}</li>
   {/foreach}
 </ul>
</div>
{/if}

{if isset($errors)}
<div class="CompanyDirectoryError">
 <ul>
   {foreach from=$errors item='one'}
     <li>{$one}</li>
   {/foreach}
 </ul>
</div>
{/if}

{if isset($items)}
  <div>
  {$firstlink} {$prevlink}  {$pagetext} {$curpage} {$oftext} {$pagecount}  {$nextlink} {$lastlink}
  </div>

  {foreach from=$items item=entry}
  <div class="CompanyDirectoryItem">
{if $entry->picture_location ne ''}
<img src="{$entry->picture_path}" />
{/if}
<a href="{$entry->detail_url}">{$entry->company_name}</a><br />
{if $entry->details ne ''}
{$entry->details|truncate:200}
<a href="{$entry->detail_url}">read more</a><br />
{/if}
   </div>
  {/foreach}
{/if}
This works exactly as expected on the "Where To Eat" page yet breaks the "Places To Stay" page. If I add another </div> after the last {/foreach} shown above, then the "Places To Stay" page works and the "Where To Eat" page breaks.

Here are links to the respective pages:
Where To Eat: http://www.tellerhomes.com/tellercounty ... ces-to-eat
Places To Stay: http://www.tellerhomes.com/tellercounty ... es-to-stay

Can anyone see what is going wrong? It's really odd because every company is added the same and using the same templates. Why would a company in one category display correctly while a company in another category break the page?

Please help if you can. This one has me stumped. Using Firebug I can see that the entry structure is different between the displayed results even though they are using the same templates.

Elkman
Last edited by elkman on Sun May 01, 2011 5:37 pm, edited 1 time in total.
User avatar
Nullig
Power Poster
Power Poster
Posts: 2380
Joined: Fri Feb 02, 2007 4:31 pm
Location: Comox Valley, BC

Re: Strange Company Directory issue

Post by Nullig »

Do they both use the same Page template?
Is the content field completed the same for both?

This looks like a problem with the page data or the page template, not the module template.

Nullig
elkman
Power Poster
Power Poster
Posts: 262
Joined: Thu Jan 11, 2007 9:16 pm
Location: Colorado

Re: Strange Company Directory issue

Post by elkman »

Yes, everything is exactly the same. I have narrowed it down to this part of the code:

Code: Select all

{if $entry->details ne ''}
{$entry->details|truncate:200}
<a href="{$entry->detail_url}">read more</a><br />
{/if}
If I take this out both pages work the same. But, the whole point was to add detail info into the summary template.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: Strange Company Directory issue

Post by calguy1000 »

oh come on now... this is so simple.

Hint: Validate your pages
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
elkman
Power Poster
Power Poster
Posts: 262
Joined: Thu Jan 11, 2007 9:16 pm
Location: Colorado

Re: Strange Company Directory issue

Post by elkman »

Well I guess that's just a nice way of calling someone a moron who asked for help.

Just for fun and to kill a few more wasted hours, I converted the original website template into a CMSSimple template. Standard CSS file, standard images, and provided HTML. All completely validated. Same as it was before I began this project. Here is a link to the actual online template which can be validated:

http://www.metamorphozis.com/free_templ ... dex_1.html

I only added the {content} tag to this template. Everything else was left in place so as to make sure validation wasn't affected in any way unless by a CMS Module.

Here is a link to this basic templated CMS site:
http://www.tellerhomes.com/tellercounty ... ge=bubbles

I have added the same Company Directory tags into the {content} of the Place To Stay page and Where To Eat page. In both situations the exact same thing has happened that I originally requested help with.

The Where To Eat page works while the Places To Stay page layout is broken again. Notice the NEWS <div> is moved. In both cases html validation is showing errors caused by the Company Directory module components.

If there isn't a way to fix it that's fine. I just don't usually ask for help until I've exhausted searching the forum, checking the html code and reviewing the css for stupid errors which I know I can miss with my failing eye sight.

If anyone can tell me what may be wrong without wasting very much of their time, that would be very helpful. Again, there's absolutely nothing added to these pages except the Company Directory tags:
{CompanyDirectory category="Where To Eat"}
{CompanyDirectory category="Places To Stay"}
uniqu3

Re: Strange Company Directory issue

Post by uniqu3 »

You do know that using truncate also cuts off html tags?
Like here:
<p>A summer vacation at Tarryall River Ranch will never be forgotten! The magnificent Rocky Mountain scenery and the clear Colorado weather combined with great activities and warm hospitality...

As you can see closing </p> is missing, so if i am not wrong strip_tags should resolve your problem.

Code: Select all

{$entry->details|truncate:200|strip_tags:true}
elkman
Power Poster
Power Poster
Posts: 262
Joined: Thu Jan 11, 2007 9:16 pm
Location: Colorado

Re: Strange Company Directory issue

Post by elkman »

No, I didn't know that.

I hadn't used "truncate" until Nicmare was kind enough to recently answer my previous post asking how to limit the Detail text content shown in a summary template used in Company Directory.

Thank you VERY MUCH for this insight. It is very helpful and appreciated!

Elkman
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12709
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: Strange Company Directory issue

Post by Dr.CSS »

I believe that was what was meant by "Validate your pages" not that you were a moron, if you had a broken page that used the same template but different tags that would be the first thing to do, look in page source to find a missing /close for a div, p or span...

If you break one of those it will throw everything off...
beherenow_uk
Forum Members
Forum Members
Posts: 103
Joined: Fri Nov 28, 2008 11:26 am

Re: [SOLVED] Strange Company Directory page layout issue

Post by beherenow_uk »

|strip_tags:true
Boom! That just solved my issue!

Thanks Goran.
Post Reply

Return to “Layout and Design (CSS & HTML)”