osCmax v2.5 User Manual
Results 1 to 7 of 7

tip for changing infobox titles without touching english/core.php

This is a discussion on tip for changing infobox titles without touching english/core.php within the osCmax v2 Customization/Mods forums, part of the osCmax v2.0 Forums category; Here is a little trick I did. I wanted to change the title "Categories" on my infobox header to "Website ...

      
  1. #1
    Senior Member blackhawk's Avatar
    Join Date
    Aug 2009
    Location
    indiana
    Posts
    640
    Blog Entries
    1
    Rep Power
    27


    Lightbulb tip for changing infobox titles without touching english/core.php

    Here is a little trick I did. I wanted to change the title "Categories" on my infobox header to "Website Template Categories". Initially I would go into catalog/include/language/english/core.php to make that change, but since oscmax is in a fast pace development sequence right now, you can simply go to catalog/templates/yourcustomtemplate/boxes/box.tpl.php and write something like this in there...

    Code:
    ...
    <td class="infoBoxHeading" width="100%" ><?php 
                                 if($boxHeading == "Categories"){
                                     echo "Website Template Categores";
                                     }else 
                                     {
                                     echo 
                                     $boxHeading;
                                     } 
                                     ?></td>
    ...
    A quick and dirty version of system override, but at least you didn't touch the core files! Read more on box editing when you download your oscmax site and set the template in your admin to "help-text".
    Last edited by michael_s; 01-18-2011 at 06:40 AM. Reason: Updated to reflect a custom template directory. Make sure you first make a custom template directory.

  2. #2
    osCMax Development Team
    pgmarshall's Avatar
    Join Date
    Feb 2009
    Location
    London
    Posts
    2,678
    Rep Power
    49


    Default Re: tip for changing infobox titles without touching english/core.php

    Don't forget that BTS has per box templating capabilities ... just copy and change box.tpl.php in templates/<your template>/boxes/<boxname>.tpl.php

    Regards,
    pgmarshall
    _______________________________

  3. #3
    osCMax Development Team
    ridexbuilder's Avatar
    Join Date
    Jul 2008
    Location
    Haggisland
    Posts
    3,014
    Rep Power
    36


    Exclamation Re: tip for changing infobox titles without touching english/core.php

    Quote Originally Posted by blackhawk View Post
    ...but at least you didn't touch the core files! ...
    Yes you did! NEVER, never, never (is that enough emphasis?) touch files in fallback.
    Jeez!
    Hosting plans with installation, configuration, contributions, support and maintenance.

  4. #4
    Senior Member blackhawk's Avatar
    Join Date
    Aug 2009
    Location
    indiana
    Posts
    640
    Blog Entries
    1
    Rep Power
    27


    Default Re: tip for changing infobox titles without touching english/core.php

    its the idea behind it, assuming people are creating there template folders based on fallback I should of addressed that!! Thanks R
    Last edited by blackhawk; 01-18-2011 at 05:08 AM.

  5. #5
    Senior Member blackhawk's Avatar
    Join Date
    Aug 2009
    Location
    indiana
    Posts
    640
    Blog Entries
    1
    Rep Power
    27


    Default Re: tip for changing infobox titles without touching english/core.php

    Here's another method I'm experimenting with. Replace any text in your infobox columns by modifying your box.tpl.php. For example, I wanted to modify my log off text in my sign-in infobox. So I created a new box page called loginbox.tpl.php and replaced the echo $boxContent code with...

    Code:
    $pattern = '/Log off/';
    $replacement = tep_image_submit('button_logout.gif', 'Log Out');
    echo preg_replace($pattern,$replacement,$boxContent);
    The above code shows that I replaced the 'Log off' text with a button called button_logout.gif (which I created and placed inside my includes/language/image/buttons folder). Then finally echo the modified $boxContent string Now when you reload your page, you'll see your text change.

  6. #6
    osCMax Development Team
    ridexbuilder's Avatar
    Join Date
    Jul 2008
    Location
    Haggisland
    Posts
    3,014
    Rep Power
    36


    Question Re: tip for changing infobox titles without touching english/core.php

    Now then, how does that work in a multilingual environment?
    Hosting plans with installation, configuration, contributions, support and maintenance.

  7. #7
    Senior Member blackhawk's Avatar
    Join Date
    Aug 2009
    Location
    indiana
    Posts
    640
    Blog Entries
    1
    Rep Power
    27


    1 out of 1 members found this post helpful.

    Default Re: tip for changing infobox titles without touching english/core.php

    not sure, but someone can try using arrays...

    Code:
    $patterns = array();
    $patterns[0] = '/Log off/';
    $patterns[1] = '/Yo get out before I bust a cap/';
    $patterns[2] = '/Please Depart/';
    $replacements = array();
    $replacements[2] = 'language string A';
    $replacements[1] = 'language string B';
    $replacements[0] = 'language string C';
    echo preg_replace($patterns, $replacements, $boxContent);
    Last edited by blackhawk; 02-02-2011 at 08:10 AM.

Similar Threads

  1. Changing color of infoBox border
    By johnaney in forum osCommerce 2.2 Modification Help
    Replies: 2
    Last Post: 08-12-2010, 01:04 AM
  2. Core.**** Files Problem
    By Schaboo in forum osCmax v2 Installation issues
    Replies: 5
    Last Post: 05-20-2010, 08:36 AM
  3. Changing Page Titles
    By Studio143 in forum osCmax v1.7 Discussion
    Replies: 0
    Last Post: 11-11-2006, 06:33 AM
  4. 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, 02:08 PM
  5. Headings errors when changing from english to german or span
    By gord in forum osCommerce 2.2 Installation Help
    Replies: 0
    Last Post: 12-25-2002, 06:35 PM

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
  •