Jump to content

How to centre...


Guest netwizard

Recommended Posts

Guest netwizard

Can somebody please show me which part of the code, in which file, I need to edit to centre everything in the latest products page?

I'm using the killer skin and by default these items are aligned to the left... it looks a bit out of place as the categories above it are centered.

Thanks to anyone who can help.

Link to comment
Share on other sites

Wow, I wrote a bunch of stuff out for you, but I forgot to "submit" and lost it :rolly:

I won't write everything out again . . .

Just look in styleTemplates/content/index.tpl and look for the division that has "float:left; text-align:center;"

Remove "float:left;"

Then look in the previous division, where you have:

<div style="margin-top: 10px;">

and add centering to that division:

<div style="margin-top: 10px; text-align:center;">

(It is the division just before the loop "BEGIN: repeat_prods")

Now test it. In some, and maybe all, browsers, you may only get one product per row without floating them to the left.

If that's the case, you may have to use a table there instead of the proposed solution I gave. At least you'll be in the right file. :P

HTH

Mark

Link to comment
Share on other sites

Guest netwizard

Mark, thanks heaps for those very simple-to-follow instructions. Unfortunately though, you were right.... I now have a verticle column of one item per row. Luckily I made a backup.

What do you mean by your last remark about a table? Is that something else I can try? Not sure I follow.

TFYH

NetWizard

Link to comment
Share on other sites

I'm just thinking out loud, really. I'm sure I could solve your problem somehow, maybe with a table having three or four equal cells across.

Have you tried changing the width of latest products, or changing quantities of latest products to show? I think there are switches for this in ACP General Settings. Maybe by adjusting width and/or number of prods per row you can make it all even.

There is a {VAL_WIDTH} variable in the file I mentioned above; I believe this is pulling the size that you set for thumbnails in ACP.

You can also specify quantity of items to show in latest prods.

Using all this info, I'm sure you can figure something out.

On your other prob, did you try the javascript I sent for "location" - just curious as to whether that solved your problem :rolly:

Link to comment
Share on other sites

Luckily I made a backup

I've said it here several times, if you are going to work on your skin, copy the whole skin folder and give it a new name! You will always have a copy of ALL the source files for your skin :rolly:

Upload your "myNewSkin" folder to the skins directory at your webserver, and you can choose "myNewSkin" from the ACP dropdown :P

Link to comment
Share on other sites

Guest netwizard

Wow Mark you are awesome. That javascript did solve the problem... is a lot better now. Just outta curiosity... is there a javascript command I can use instead of location='page url' to make the page not change? eg stay here.

The reason I ask is because that Live Help button is on the global template, and if my customer is looking at a particular item, I dont want to take her back to the index page when she asks for help.

TYVM

I think I'll leave the centering of the middle panel for now.. it seems a bit too hard for me right now.

Link to comment
Share on other sites

Hmm, yes there has to be a way, but I don't know. Maybe someone else could help. There may be a tag in CC that would tell it to reload the {current_page} at the link location. Let's throw it out there and see if someone else has your answer . . .

PROBLEM

At Netwizard's site, he has a link to a chat feature, but when a visitor clicks the link, the chat box window would open, but the original browser window would go blank with only the text "[Object]" showing on the page. The link was coded like this:

<a href="javascript:window.open('chat_url')">




I advised him to change the link to this:




<a href="javascript:location='http://store_url/index.php';window.open('chat_url')">

This works to load the homepage into the browser window that contained the link. Problem is, the link appears in the right column of the store on all the store pages.

How can javascript tell the browser to load the current page back in to the window containing the link when opening the new window? Anybody?

-------------------------

According to my little javascript reference, there are eight properties that go with location:

hash

host

hostname

href

pathname

port

protocol

search

If any of that may help you script writers out there . . .

Link to comment
Share on other sites

Well, netwizard, no one has answered yet - maybe someone will eventually.

If this were my problem, here is what I would try: Poke around the CC files to find if there is a variable used to show current location, it would probably look like {CURRENT} OR {CURRENT_PAGE}, etc.

Then try java script:location='{CURRENT_PAGE}';

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...