You are here:  » external.php column width

Support Forum



external.php column width

Submitted by roymartian on Sun, 2010-06-06 07:03 in

Hi there,

Now successfully using PT in Word Press using the external.php file - works great.

Just playing with css, however do need to adjust column width between content column, seems I have blank column between actual content   not sure what to adjust in external.php tried changing $columnWidth = intval(100/$columns); but didn't seem to change anything.

Appreciate advice or help.

Best Regards,
Roger.

Submitted by support on Mon, 2010-06-07 09:17

Hi Roger,

The $columnWidth variable in external.php only applies to the A-Z table (used for the merchant/category/brand index pages) - that's all.

Everything else affecting the layout of the html modules (e.g. html/searchresults.php) would be down to the CSS of your WordPress site containing the appropriate classes and rules to style the content as you would like - as of course when not displayed within Price Tapestry the original default.css does not apply.

Most of the files in html/ contain an enclosing DIV with a class corresponding to the section of the site, e.g. at the top of html/searchresults.php you will find:

<div class='searchresults'>

...so to manage the layout of search results such as on your example page, could could add to your WordPress theme's CSS something like:

.searchresults {
  width: 500px;
}

I couldn't quite tell from the example URL where the blank column was appearing so it may be that you've fixed the problem since your post, hope this helps otherwise...!

Cheers,
David.

Submitted by roymartian on Mon, 2010-06-07 12:56

Hi David,

Thanks for clarifying for me, will continue to experiment by adjusting .searchresults in wordpress css

Seems width: 500px only adjust total table width, really trying to adjust individual column widths if you have any tips, I appreciate this is not really a PT questions.

Thanks again - I will try a few options.

Roger.

Submitted by support on Mon, 2010-06-07 13:16

Hi Roger,

It's probably best to modify the individual column widths within html/searchresults.php from your Price Tapestry installation - as this is what is included by external.php.

In that file, search for each <td> tag, and then add width='x' attributes as required - for example the image column is opened with just:

        <td>

(line 8), so you could REPLACE that with:

        <td width='150'>

If your Price Tapestry installation is being visited by users as well as your using external.php, and you don't want the forced column widths to apply there, the best thing to do is to create a copy of html/searchresults.php called, for example, html/searchresultsexternal.php. Then, search your external.php for the following code:

require($external_path."html/searchresults.php");

...and REPLACE with:

require($external_path."html/searchresultsexternal.php");

Hope this helps!

Cheers,
David.

Submitted by roymartian on Tue, 2010-06-08 02:24

Yes it does, thanks David great help.

Will adjust and try

Cheers,
R

Submitted by roymartian on Tue, 2010-06-08 12:04

Hi David,

Looking at html/searchresults.php I can see the <td> and also the <td width='50'>&nbsp;</td> which is causing my issues in http://www.ukdirect.com.au/amazon-co-uk/feeds/

However after changing there's appears to be no affect.

Grateful if you could advise - sorry, must be something simple on my behalf.

I am using external.php file if this is relevant, my page code is also below;

{code saved}

Thank you,
Roger

Submitted by support on Tue, 2010-06-08 12:23

Hi Roger,

The <td width='50'>&nbsp;</td> sections are only spacers for use in the "out of the box" template where the search results are displayed in a wider space.

Perhaps the best way to proceed would be to delete those lines, and then just add % widths to the remaining <td>'s, for example, for the last column (more info / compare prices link):

<td valign='middle' align='center' width='20%'>

Hope this helps!

Cheers,
David.

Submitted by roymartian on Wed, 2010-06-09 11:47

Thanks David, will continue to investigate.

Maybe its my WP theme, as deleting   means I lose all content except image.

No worries, I appreciate this is a css issue.

Thanks,
Roger.

Submitted by roymartian on Wed, 2010-06-09 11:56

This css seems to be working!

.searchresults td {
width: 5px;

Thanks,
Roger