Results 1 to 10 of 12

Hybrid View

  1. #1
    Join Date
    Sep 2008
    Location
    Melbourne, Australia
    Posts
    5
    Plugin Contributions
    0

    Default Re: editing define_main_page

    Thanks, columns are displaying correctly, I have to work out how to make them a fixed size and not resize when entering text and inserting images.
    Can you tell me how to go about entering image paths correctly, as images are broken?
    Regards

  2. #2
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,266
    Plugin Contributions
    3

    Default Re: editing define_main_page

    Quote Originally Posted by peterapo View Post
    Thanks, columns are displaying correctly, I have to work out how to make them a fixed size and not resize when entering text and inserting images.
    Just use cell width and height setting as follows:

    for pixel width.
    HTML Code:
    <table border="0" width="300">
    	<tr>
    <td width="100" height="100">&nbsp;</td>
    for percentage width.
    HTML Code:
    <table border="0" width="100%">
    	<tr>
    <td width="30%" height="30%">&nbsp;</td>
    As I said, basic HTML is OK - so don't be frightened to use it.

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

    Quote Originally Posted by peterapo View Post
    Can you tell me how to go about entering image paths correctly, as images are broken?
    Regards
    The PATH to the images depends entirely on where you store the images.

    In your zencart webshop, you have an images folder at the root level of the installation.

    What I do (to distinguish index page design element images from product images) is create a sub-folder in the images folder, and call that folder defined-pages.

    That is where I store images that appear in any defined page that appear

    The PATH in this case, will be:
    Code:
    images/defined-pages/picture1.jpg
    Note that if the link to the image is internal, you need only have the path shown as I show above, because ZC will put into your header, the <base-href="............"> tag.

    Naturally, EXTERNAL images will require the FULL path:

    HTML Code:
    http://www.some-other-website.com/images/picture.jpg
    Note that in this case (full path), you run the risk of Browser SSL warnings when/if you invoke SSL on your server, if the PATH to an element is itself insecure... ie: http:// instead of https://
    20 years a Zencart User

  3. #3
    Join Date
    Nov 2006
    Location
    Dartmouth, NS Canada
    Posts
    2,378
    Plugin Contributions
    0

    Default Re: editing define_main_page

    Another way to do it, without using tables or hardwired sizes, is to enter your columns of info inside DIVs with class names and then style the classes in your stylesheet. Makes for cleaner code. One drawback is that vertical alignment issues are harder to deal with in CSS than in tables. Here's the general idea...

    <div class="col1">
    <h3>Header</h3>
    <div class="img"><img code here...></div>
    <div class="txt">text here</div>
    </div>

    <div class="col2">
    <h3>Header</h3>
    <div class="img"><img code here...></div>
    <div class="txt">text here</div>
    </div>

    <div class="col3">
    <h3>Header</h3>
    <div class="img"><img code here...></div>
    <div class="txt">text here</div>
    </div>

    <div class="col4">
    <h3>Header</h3>
    <div class="img"><img code here...></div>
    <div class="txt">text here</div>
    </div>

    Define the column classes something like...
    .col1 {
    height: 1%;
    width: 23%;
    float: left; }

    The 1% height is the Holly Hack to avoid IE display bugs. Adjust the 23% as need to keep everything within your centercolumn. You may have to play with that float: left; definition to make everything line up. I only use two columns and have float: left on the left one and float: right on the right one. It gets trickier when you need more columns I think.

    Define the img and txt classes as needed for your purposes.

    Rob

    P.S.
    You could also just put the class names into the table structure instead and then add the styles to the stylesheet. Makes adjusting things easier than editing a bunch of hard-coded values.

  4. #4
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,266
    Plugin Contributions
    3

    Default Re: editing define_main_page

    I just gotta get me a load of those donuts! See how clever you become when you eat Rob's donuts.
    20 years a Zencart User

  5. #5
    Join Date
    Mar 2009
    Posts
    435
    Plugin Contributions
    0

    Default Re: editing define_main_page

    I love this forum. Would be lost with out it, exactly what I needed to do add text and images etc to the main page. Thanks guys

  6. #6
    Join Date
    Sep 2008
    Location
    DownUnder, overlooking South Pole.
    Posts
    984
    Plugin Contributions
    6

    Default Re: editing define_main_page

    I want to setup a defined page called main.html, as opposed to index.html, that is based on the About_Us mod. Would there be any conflicts with zc code in doing so.

    TIA

  7. #7
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,266
    Plugin Contributions
    3

    Default Re: editing define_main_page

    Quote Originally Posted by dw08gm View Post
    I want to setup a defined page called main.html, as opposed to index.html, that is based on the About_Us mod. Would there be any conflicts with zc code in doing so.

    TIA
    What you are suggesting is not within the context of a PHP-driven site.

    The DEFINED PAGES are actually just PARTS of raw html code that get "parsed" into the display - that display having been assembled by the php code.

    You have to "think differently" when working with PHP - expecially if you've come out of a flat html background.

    Strictly speaking, there are no "pages" in zencart (or any other content-managed system).

    "Web pages" come into existence only when a user sends a request for them to be assembled, and the php then gets to work to cobble the elements together before delivering the result to the browser. When the user clicks a link, the page they are on "evaporates" forever, and a new "page" is assembled in its place.

    So... You can't use files with .html extensions. They make no sense in this context.

    ... Or rather, you CAN create a html page... but it will exist outside of the schema.
    20 years a Zencart User

 

 

Similar Threads

  1. Editing define_main_page corrupts home page?
    By kevinmc3 in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 11 May 2009, 01:35 AM
  2. While editing define_main_page.php
    By JannyM in forum Customization from the Admin
    Replies: 2
    Last Post: 9 May 2009, 06:33 PM
  3. define_main_page
    By balihr in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 28 Oct 2008, 09:47 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg