am: 14. Dezember 2017, 12:37:25
Guten Tag liebe Community,
momentan versuche ich eine Box zu erstellen, der man Einträge im Content-Manager zuweisen kann, die diese dann als Liste+Links anzeigen soll.
Dabei habe ich mich an diese Anleitung gehalten:
https://www.modified-shop.org/wiki/Tutorial:_Erstellung_BoxStecke bei "Einfügung in Layout" fest: Nach einfügen des
require_once(DIR_WS_BOXES . 'nav.php'); erscheint die Box, die ich "Nav" genannt habe, nicht auf der Seite. In der Smarty Debug-Konsole wird meine neue Box auch nicht aufgeführt.
Über einen Richtungshinweis wäre ich überaus dankbar!
Mein Code in <template>/source/boxes.php:
(Habe ich die Zeile vielleicht an die falsche Stelle gesetzt? Das Tutorial ist da nicht sehr klar)
<?php/* -----------------------------------------------------------------------------------------
$Id: boxes.php 10541 2016-12-21 08:43:33Z Tomcraft $
modified eCommerce Shopsoftware
http://www.modified-shop.org
Copyright (c) 2009 - 2013 [www.modified-shop.org]
-----------------------------------------------------------------------------------------
based on:
(c) 2006 XT-Commerce
Released under the GNU General Public License
---------------------------------------------------------------------------------------*/// css buttonsif (file_exists(DIR_FS_CATALOG
.'templates/'.CURRENT_TEMPLATE
.'/source/inc/css_button.inc.php')) { require_once ('templates/'.CURRENT_TEMPLATE
.'/source/inc/css_button.inc.php');}// define full content sites$fullcontent = array(FILENAME_CHECKOUT_SHIPPING
, FILENAME_CHECKOUT_PAYMENT
, FILENAME_CHECKOUT_CONFIRMATION
, FILENAME_CHECKOUT_SUCCESS
, FILENAME_CHECKOUT_SHIPPING_ADDRESS
, FILENAME_CHECKOUT_PAYMENT_ADDRESS
, FILENAME_ACCOUNT
, FILENAME_ACCOUNT_EDIT
, FILENAME_ACCOUNT_HISTORY
, FILENAME_ACCOUNT_HISTORY_INFO
, FILENAME_ACCOUNT_PASSWORD
, FILENAME_ACCOUNT_DELETE
, FILENAME_ACCOUNT_CHECKOUT_EXPRESS
, FILENAME_CREATE_ACCOUNT
, FILENAME_CREATE_GUEST_ACCOUNT
, FILENAME_ADDRESS_BOOK
, FILENAME_ADDRESS_BOOK_PROCESS
, FILENAME_PASSWORD_DOUBLE_OPT
, FILENAME_ADVANCED_SEARCH_RESULT
, FILENAME_ADVANCED_SEARCH
, FILENAME_SHOPPING_CART
, FILENAME_GV_SEND
, FILENAME_NEWSLETTER
, FILENAME_LOGIN
, FILENAME_CONTENT
, FILENAME_REVIEWS
, FILENAME_WISHLIST
, FILENAME_CHECKOUT_PAYMENT_IFRAME
, );// -----------------------------------------------------------------------------------------// full content// ----------------------------------------------------------------------------------------- if (!in_array(basename($PHP_SELF), $fullcontent)) { require_once(DIR_FS_BOXES
. 'categories.php'); require_once(DIR_FS_BOXES
. 'manufacturers.php'); require_once(DIR_FS_BOXES
. 'last_viewed.php'); require_once(DIR_WS_BOXES
. 'nav.php'); } else { // smarty full content $smarty->assign('fullcontent', true); }// -----------------------------------------------------------------------------------------// always visible// ----------------------------------------------------------------------------------------- require_once(DIR_FS_BOXES
. 'search.php'); require_once(DIR_FS_BOXES
. 'content.php'); require_once(DIR_FS_BOXES
. 'information.php'); require_once(DIR_FS_BOXES
. 'miscellaneous.php'); require_once(DIR_FS_BOXES
. 'languages.php'); require_once(DIR_FS_BOXES
. 'infobox.php'); require_once(DIR_FS_BOXES
. 'loginbox.php'); if (!defined('MODULE_NEWSLETTER_STATUS') || MODULE_NEWSLETTER_STATUS
== 'true') { require_once(DIR_FS_BOXES
. 'newsletter.php'); } if (defined('MODULE_TS_TRUSTEDSHOPS_ID') && (MODULE_TS_WIDGET
== '1' || (MODULE_TS_REVIEW_STICKER
!= '' && MODULE_TS_REVIEW_STICKER_STATUS
== '1')) ) { require_once(DIR_FS_BOXES
. 'trustedshops.php'); }// -----------------------------------------------------------------------------------------// only if show price// ----------------------------------------------------------------------------------------- if ($_SESSION['customers_status']['customers_status_show_price'] == '1') { require_once(DIR_FS_BOXES
. 'add_a_quickie.php'); require_once(DIR_FS_BOXES
. 'shopping_cart.php'); if (defined('MODULE_WISHLIST_SYSTEM_STATUS') && MODULE_WISHLIST_SYSTEM_STATUS
== 'true') { require_once(DIR_FS_BOXES
. 'wishlist.php'); } }// -----------------------------------------------------------------------------------------// hide in search// ----------------------------------------------------------------------------------------- if (substr(basename($PHP_SELF), 0,8) != 'advanced' && WHATSNEW_CATEGORIES
=== false) { require_once(DIR_FS_BOXES
. 'whats_new.php'); }// -----------------------------------------------------------------------------------------// admins only// ----------------------------------------------------------------------------------------- if ($_SESSION['customers_status']['customers_status'] == '0') { require_once(DIR_FS_BOXES
. 'admin.php'); $smarty->assign('is_admin', true); }// -----------------------------------------------------------------------------------------// product details// ----------------------------------------------------------------------------------------- if ($product->isProduct() === true) { require_once(DIR_FS_BOXES
. 'manufacturer_info.php'); } else { require_once(DIR_FS_BOXES
. 'best_sellers.php'); if ($_SESSION['customers_status']['customers_status_specials'] == '1' && SPECIALS_CATEGORIES
=== false) { require_once(DIR_FS_BOXES
. 'specials.php'); } }// -----------------------------------------------------------------------------------------// only logged id users// ----------------------------------------------------------------------------------------- if (isset($_SESSION['customer_id'])) { require_once(DIR_FS_BOXES
. 'order_history.php'); }// -----------------------------------------------------------------------------------------// only if reviews allowed// ----------------------------------------------------------------------------------------- if ($_SESSION['customers_status']['customers_status_read_reviews'] == '1') { require_once(DIR_FS_BOXES
. 'reviews.php'); }// -----------------------------------------------------------------------------------------// hide during checkout// ----------------------------------------------------------------------------------------- if (substr(basename($PHP_SELF), 0, 8) != 'checkout') { require_once(DIR_FS_BOXES
. 'currencies.php'); }// -----------------------------------------------------------------------------------------// -----------------------------------------------------------------------------------------// Smarty home// -----------------------------------------------------------------------------------------$smarty->assign('home', ((basename($PHP_SELF) == FILENAME_DEFAULT
&& !isset($_GET['cPath']) && !isset($_GET['manufacturers_id'])) ?
1 : 0));// -----------------------------------------------------------------------------------------// Smarty bestseller// -----------------------------------------------------------------------------------------$smarty->assign('bestseller', strpos($PHP_SELF, FILENAME_LOGOFF
) || strpos($PHP_SELF, FILENAME_CHECKOUT_SUCCESS
) || strpos($PHP_SELF, FILENAME_SHOPPING_CART
) || strpos($PHP_SELF, FILENAME_NEWSLETTER
));// -----------------------------------------------------------------------------------------$smarty->assign('tpl_path', DIR_WS_BASE
.'templates/'.CURRENT_TEMPLATE
.'/');?> In <template>/source/boxes/nav.php:
Habe ich einfach erstmal aus der Info-Box kopiert, da ich ja etwas ähnliches machen möchte und Information mit nav ersetzt. Ich hoffe das passt soweit?
<?php/* -----------------------------------------------------------------------------------------
$Id:$
modified eCommerce Shopsoftware
http://www.modified-shop.org
Copyright (c) 2009 - 2013 [www.modified-shop.org]
-----------------------------------------------------------------------------------------
based on:
(c) 2000-2001 The Exchange Project (earlier name of osCommerce)
(c) 2002-2003 osCommerce(information.php,v 1.6 2003/02/10); www.oscommerce.com
(c) 2003 nextcommerce (content.php,v 1.2 2003/08/21); www.nextcommerce.org
(c) 2003 XT-Commerce
Released under the GNU General Public License
---------------------------------------------------------------------------------------*/// include smartyinclude(DIR_FS_BOXES_INC
. 'smarty_default.php');// set cache id$cache_id = md5($_SESSION['language'].$_SESSION['customers_status']['customers_status_id'].(isset($coPath) ?
$coPath : '0'));if (!$box_smarty->is_cached(CURRENT_TEMPLATE
.'/boxes/box_nav.html', $cache_id) || !$cache) { // include needed functions require_once (DIR_FS_CATALOG
.'templates/'.CURRENT_TEMPLATE
.'/source/inc/xtc_show_content.inc.php'); require_once (DIR_FS_CATALOG
.'templates/'.CURRENT_TEMPLATE
.'/source/inc/close_ul_tags.inc.php'); $content_array = array(); $content_string = ''; $content_query = xtDBquery
("SELECT content_id,
categories_id,
parent_id,
content_title,
content_group
FROM ".TABLE_CONTENT_MANAGER
."
WHERE languages_id='".(int
) $_SESSION['languages_id']."'
AND file_flag='0'
".CONTENT_CONDITIONS
."
AND content_status='1'
AND content_active='1'
AND trim(content_title) != ''
AND parent_id='0'
ORDER BY sort_order"); if (xtc_db_num_rows
($content_query, true) > 0) { unset ($prev_cid); unset ($first_content_element); while ($content_data = xtc_db_fetch_array
($content_query, true)) { $content_array[$content_data['content_id']] = array( 'name' => $content_data['content_title'], 'parent' => $content_data['parent_id'], 'level' => 0, 'coID' => $content_data['content_group'], 'path' => $content_data['content_id'], 'next_id' => false ); if (isset ($prev_cid)) { $content_array[$prev_cid]['next_id'] = $content_data['content_id']; } $prev_cid = $content_data['content_id']; if (!isset ($first_information_element)) { $first_information_element = $content_data['content_id']; } } if (isset($coPath)) { $new_path = ''; $coid = explode('_', $coPath); reset($coid); while (list ($key, $value) = each($coid)) { unset ($prev_cid); unset ($first_cid); $content_query = xtDBquery
("SELECT content_id,
parent_id,
content_title,
content_group
FROM ".TABLE_CONTENT_MANAGER
."
WHERE languages_id='".(int
) $_SESSION['languages_id']."'
AND file_flag='0'
".CONTENT_CONDITIONS
."
AND content_status='1'
AND content_active='1'
AND trim(content_title) != ''
AND parent_id='".$value."'
ORDER BY sort_order"); if (xtc_db_num_rows
($content_query, true) > 0) { $new_path .= $value; while ($content = xtc_db_fetch_array
($content_query, true)) { $content_array[$content['content_id']] = array( 'name' => $content['content_title'], 'parent' => $content['parent_id'], 'level' => $key +1, 'coID' => $content['content_group'], 'path' => $new_path.'_'.$content['content_id'], 'next_id' => false ); if (isset ($prev_cid)) { $content_array[$prev_cid]['next_id'] = $content['content_id']; } $prev_cid = $content['content_id']; if (!isset ($first_cid)) { $first_cid = $content['content_id']; } $last_cid = $content['content_id']; } $content_array[$last_cid]['next_id'] = isset($content_array[$value]['next_id']) ?
$content_array[$value]['next_id'] : 0; $content_array[$value]['next_id'] = $first_cid; $new_path .= '_'; } else { break; } } } if(!empty($first_information_element)) { xtc_show_content
($first_information_element); } $box_smarty->assign('BOX_CONTENT', $content_string); }}if (!$cache) { $box_nav = $box_smarty->fetch(CURRENT_TEMPLATE
.'/boxes/box_nav.html');} else { $box_nav = $box_smarty->fetch(CURRENT_TEMPLATE
.'/boxes/box_nav.html', $cache_id);}$smarty->assign('box_NAV', $box_nav);?> In box_nav.html in <template>/boxes/
steht bisher einfach nur
{config_load
file="$language/lang_$language.conf" section
="boxes"}<h2
class="boxheader">{#heading_nav#}</h2>
<div
class="boxbody">{$BOX_CONTENT}</div
> Freundliche Grüße
Linkback: https://www.modified-shop.org/forum/index.php?topic=38388.0