Full service web hosting, great prices and support. Starts at $1.99/month!
Results 1 to 10 of 10

Thread: infobox headings as links?

  1. #1
    Tania
    Guest


    Question infobox headings as links?

    Hi,

    I've tried searching the forum as well as osCMax and osCommerce docs and contributions but can't find how to create links from the infobox headers. There is a contribution but I can't figure out how to make it apply to oscMax v.2.0.25 with the Compromise template.

    Can anyone help? It would be much appreciated!

  2. #2
    blackhawk
    Guest


    Default Re: infobox headings as links?

    no need to add another module - just read the oscmax wiki - http://wiki.oscdox.com/adding_new_dynamic_content_pages the wiki is written by the jedi minds of oscmax so take your time through the entire dox.

    another alternative is to add article pages (already comes with oscmax - controlled in the admin) - much easier.

    bh

  3. #3
    Tania
    Guest


    Default Re: infobox headings as links?

    Thanks Blackhawk!

    I did see this doc and have used the info to create new pages in the information box. However, what I need is to create a link around the header text of a new box. I've tried modifying <?php echo $boxHeading; ?> in a copy of boxes.tpl.php in the Compromise template but always end up with really wonky results. And I can't find where in all the files the $boxLink is defined so I have no idea what to do with it (the code reference has no mention of this variable).
    Michael_S had put up a contribution (osCommerce Community Add-Ons) which would do exactly what I want.

    But once the instructions get to modifying the corresponding box's .php file, they don't fit with the code in the template. I'm too much of a PHP noob to figure this out.

    Code:
    <?php /* template for all boxes, edit and "save as" for individual  boxes */ ?>
    <div id="<?php if (isset($box_id)) {echo $box_id . 'LT';} ?>"  summary="infoBox">
        <ul>
                <p></p>
            <li>
                <h2><?php echo $boxHeading;  ?></h2><?php echo $boxLink; ?>
                <p></p>
                    <?php echo $boxContent; ?>
           </li>    
                <p></p>
    
    <!--            <ul>
                         <li></li>
                         <p></p>
                  </ul> -->
        </ul>
    </div>
    I suppose I could just clear out the tpl.php file for the box and put in a straight html link (don't need content in this box), then style it to resemble the other boxes, but I'd like to learn to to do this the proper way, according to the existing code.

    I'm not sure if this makes any sense, but I'm trying... be patient with me

  4. #4
    blackhawk
    Guest


    Default Re: infobox headings as links?

    no need to go through the storm - open catalog/includes/languages/english.php and look around line 128 to make your header text become urls. Simply change the DEFINE "Information" text to an html url. But make sure you use double quotes for the href and then use single quotes to enclose the whole thing - get my drift?

    I believe this is the proper way

  5. #5
    Tania
    Guest


    Default Re: infobox headings as links?

    It's really that easy? Excellent! Thanks ever so much.

  6. #6
    Tania
    Guest


    Default Re: infobox headings as links?

    In case anyone is interested...

    I wanted to keep to the original coding conventions so I did the following:

    Created whats_new.tpl.php and inserted the following code:

    PHP Code:
    <?php /* template for all boxes, edit and "save as" for individual boxes */ ?>
    <div id="<?php if (isset($box_id)) {echo $box_id 'LT';} ?>" summary="infoBox">
        <ul>
            <li>
            <a href="<?php echo tep_href_link(FILENAME_PRODUCTS_NEW); ?>"><?php echo $boxHeading?></a>
            </li>
        </ul>
    </div>

  7. #7
    osCMax Development Team

    infobox headings as links?

    ridexbuilder's Avatar
    Join Date
    Jul 2008
    Location
    Haggisland
    Posts
    4,164
    Contribute If you enjoy reading the
    content here, click the below
    image to support our site.
    Click Here To Contribute To Our Site

    Total Contributions For

    ridexbuilder     $ 15.00
    Rep Power
    99


    Default Re: infobox headings as links?

    Share with the community - well done

    Developers resource at bitbucket
    *** *** ***
    oscmax.co.uk / ejsolutions.co.uk
    Hosting plans with installation, configuration, contributions, support and maintenance.
    *** FREE osCmax hosting available ***
    oscmaxtemplates.com

  8. #8
    osCMax Development Team

    infobox headings as links?

    pgmarshall's Avatar
    Join Date
    Feb 2009
    Location
    London
    Posts
    3,517
    Contribute If you enjoy reading the
    content here, click the below
    image to support our site.
    Click Here To Contribute To Our Site

    Total Contributions For

    pgmarshall     $ 35.00
    Rep Power
    81


    Smile Re: infobox headings as links?

    This will definitely go into v2.1 ... always annoyed me having click the tiny arrow image!

    Although, the code for the building the link is already in the catalog/includes/boxes code using

    Code:
    <?php echo $boxLink; ?>
    for example:catalog/includes/boxes/specials.php

    Code:
    $boxLink = '<a href="' . tep_href_link(FILENAME_SPECIALS) . '"><img src="images/infobox/arrow_right.gif" border="0" alt="more" title=" more " width="12" height="10"></a>';
    So perhaps - rather than putting the link to the infoBoxHeader in twice we should consolidate the code a bit? Merge $boxHeading and $boxLink ...

    Perhaps simply adding the link code to $boxHeading and removing $boxLink alltogether ...

    Eg.

    Code:
    $boxHeading = '<a href="' . tep_href_link(FILENAME_SPECIALS) . '">' .  BOX_HEADING_SPECIALS . '<img src="images/infobox/arrow_right.gif" border="0" alt="more" title=" more " width="12" height="10"></a>';
    and then in the template/boxes/box.tpl.php remove

    Code:
    <?php echo $boxLink; ?>
    From line 9.

    This would mean that the link was only set once in one place ...

    Thoughts?

    Regards,
    pgmarshall
    _______________________________

  9. #9
    osCMax Development Team

    infobox headings as links?

    ridexbuilder's Avatar
    Join Date
    Jul 2008
    Location
    Haggisland
    Posts
    4,164
    Contribute If you enjoy reading the
    content here, click the below
    image to support our site.
    Click Here To Contribute To Our Site

    Total Contributions For

    ridexbuilder     $ 15.00
    Rep Power
    99


    Post Re: infobox headings as links?

    Does appear pointless to have duplicated code. IMO, $boxHeading is obvious as to its' purpose and should remain.

    Developers resource at bitbucket
    *** *** ***
    oscmax.co.uk / ejsolutions.co.uk
    Hosting plans with installation, configuration, contributions, support and maintenance.
    *** FREE osCmax hosting available ***
    oscmaxtemplates.com

  10. #10
    blackhawk
    Guest


    Default Re: infobox headings as links?

    I also agree - best to consolidate

Similar Threads

  1. Links in Infobox header text
    By michael_s in forum New osCommerce Contributions
    Replies: 0
    Last Post: 03-04-2008, 10:40 AM
  2. Help Changing infobox headings from text to an image
    By seandon01 in forum osCommerce 2.2 Modification Help
    Replies: 1
    Last Post: 12-31-2004, 03:08 PM
  3. stylesheet and info box headings
    By DiamondC in forum osCommerce 2.2 Modification Help
    Replies: 1
    Last Post: 01-22-2004, 08:43 PM
  4. Changing the color of the box headings
    By annea03 in forum osCommerce 2.2 Modification Help
    Replies: 2
    Last Post: 09-03-2003, 12:06 PM
  5. How can I change the box headings
    By Marko in forum osCommerce 2.2 Modification Help
    Replies: 2
    Last Post: 05-20-2003, 06:02 PM

Bookmarks

Bookmarks

Posting Permissions

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