-
AuthorPosts
-
April 25, 2014 at 1:00 pm #197072
When i add module.php to <mytemplate>/html/ it crash whole site
im using t3-blankI want to modify module.php to add link to module title
I dont know any other option to do that
maybe there is some default module.php file that works correctly with T3
chavan Friendchavan
- Join date:
- October 2014
- Posts:
- 4612
- Downloads:
- 0
- Uploads:
- 110
- Thanked:
- 1440 times in 1290 posts
April 25, 2014 at 2:29 pm #532427There are quite a few place where you can edit
pluginssystemt3base-bs3htmlmodules.php
pluginssystemt3basehtmlmodules.php
Hope this helps
April 25, 2014 at 7:41 pm #532455yes it help
but there is one more problem i have some php code for it but i dont know how to add this to T3 module.php 🙁My code look like this
[PHP]<?php if ($module->showtitle != 0) : ?>
<?php $title_link = $params->get(‘title_link’); ?>
<h3><?php if($title_link) { ?> <a href=”<?php echo $params->get(‘title_link’); ?>”> <?php } ?><?php echo $module->title; ?><?php if($title_link) { ?></a><?php } ?></h3>
<?php endif; ?>[/PHP]can You help me with that??
chavan Friendchavan
- Join date:
- October 2014
- Posts:
- 4612
- Downloads:
- 0
- Uploads:
- 110
- Thanked:
- 1440 times in 1290 posts
April 26, 2014 at 3:02 am #532482can you please post your site Url , admin details and ftp details in PM. so I can look into it directly.
chavan Friendchavan
- Join date:
- October 2014
- Posts:
- 4612
- Downloads:
- 0
- Uploads:
- 110
- Thanked:
- 1440 times in 1290 posts
April 28, 2014 at 2:08 am #532634you can custom field for link only for SP Accordion module and how do you want it to reflect on all pages ? please advice I don’t understand.
April 28, 2014 at 5:53 am #532646Ok i add field like custom field in accordion module for link address and I need to change module.php on my template
I have to modify this part of code [PHP]function modChrome_T3Xhtml($module, &$params, &$attribs)
{
$badge = preg_match (‘/badge/’, $params->get(‘moduleclass_sfx’))? ‘<span class=”badge”> </span>’ : ”;
$moduleTag = htmlspecialchars($params->get(‘module_tag’, ‘div’));
$headerTag = htmlspecialchars($params->get(‘header_tag’, ‘h3’));
$headerClass = $params->get(‘header_class’);
$bootstrapSize = $params->get(‘bootstrap_size’);
$moduleClass = !empty($bootstrapSize) ? ‘ col-sm-‘ . (int) $bootstrapSize . ” : ”;
$moduleClassSfx = htmlspecialchars($params->get(‘moduleclass_sfx’));if (!empty ($module->content)) {
$html = “<{$moduleTag} class=”t3-module module{$moduleClassSfx} {$moduleClass}” id=”Mod{$module->id}”>” .
“<div class=”module-inner”>” . $badge;
if ($module->showtitle != 0) {
$html .= “<{$headerTag} class=”module-title {$headerClass}”><span>{$module->title}</span></{$headerTag}>”;
}$html .= “<div class=”module-ct”>{$module->content}</div></div></{$moduleTag}>”;
echo $html;
}
}[/PHP] to add in title line new field taken from module settings called title linkso in normal module.php it should look like this
[PHP]<?php if ($module->showtitle != 0) : ?>
<?php $title_link = $params->get(‘title_link’); ?>
<h3><?php if($title_link) { ?> <a href=”<?php echo $params->get(‘title_link’); ?>”> <?php } ?><?php echo $module->title; ?><?php if($title_link) { ?></a><?php } ?></h3>
<?php endif; ?>[/PHP]and the question is how to change yours module.php to have the same functionality
edit
for now I do something like this
if ($module->showtitle != 0) {
$html .= “<{$headerTag} class=”module-title {$headerClass}”><a href=”{$title_link}”/><span>{$module->title}</span></a></{$headerTag}>”;
}and it works but it add link to each module title is it possible to add some if function to check is there a title link entered or not with some else option?
-
AuthorPosts
This topic contains 7 replies, has 2 voices, and was last updated by chavan 10 years, 7 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum