satkin2 Posted November 7, 2010 Posted November 7, 2010 Hi, I've downloaded and implemented the Back Button Contribution It works great to take me back to the category page, but what I'd like to do is tweak it slightly so that rather than using the back button image I use Back to category_name I can't find anywhere where this is being done or how I'd go about it, so I thought I'd see if someone knows how to do it on here. I assume it's a simple bit of php but being very much a novice in this field I'm not sure where to begin. Thanks Steve
♥mdtaylorlrim Posted November 8, 2010 Posted November 8, 2010 Hi, I've downloaded and implemented the Back Button Contribution It works great to take me back to the category page, but what I'd like to do is tweak it slightly so that rather than using the back button image I use I can't find anywhere where this is being done or how I'd go about it, so I thought I'd see if someone knows how to do it on here. I assume it's a simple bit of php but being very much a novice in this field I'm not sure where to begin. Thanks Steve Steve, I have never looked at this but would think it would be a matter of reading the breadcrumb and parsing it to find the parent category. I don't think there is anything that keeps up with the previous category, if you hop around. Community Bootstrap Edition, Edge Avoid the most asked question. See How to Secure My Site and How do I...?
satkin2 Posted November 8, 2010 Author Posted November 8, 2010 Steve, I have never looked at this but would think it would be a matter of reading the breadcrumb and parsing it to find the parent category. I don't think there is anything that keeps up with the previous category, if you hop around. Hi, Sorry to be a bit dim, I understand what you're meaning, but don't have a clue how this would be done
satkin2 Posted November 8, 2010 Author Posted November 8, 2010 I've had a play around with some other code from within my project and come up with the following solution. Don't know if this is good coding or not, but it does the job for me <?php $category_name_query = tep_db_query("select cd.categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " cd where cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "'"); $category_name = tep_db_fetch_array($category_name_query); $category_text = $category_name['categories_name']; $back_text = "Back to $category_text"; ?> Then for the cell where I want the text to take me back to my containing category <td class="main" align="center"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT, tep_get_path($current_category_id = '')) . '">' . $back_text . '</a>'; ?></td>
Recommended Posts
Archived
This topic is now archived and is closed to further replies.