Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Add Link to Module Title

Add Link to Module Title 2 months 6 days ago #698

  • vgudenus
  • vgudenus's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 13
  • Karma: 0
hi
how can i change the title of a module so the when clicked on it, it will redirect you to a specific website.. so how to make the Module Title a Link

in my case the news&events title should redirect me to my news site...


are there any available header classes that could achieve that?

thx viktor
The administrator has disabled public write access.

Add Link to Module Title 2 months 2 days ago #736

  • salem
  • salem's Avatar
  • OFFLINE
  • Moderator
  • Posts: 77
  • Thank you received: 10
  • Karma: 5
Hi,

Please see this tutorials, it can help you :

itc.webmaasters.com/use-module-title-as-link-in-joomla-1-5-1-6-1-7-2-5-simple-hack/

Best regards.
salem.
The administrator has disabled public write access.

Add Link to Module Title 2 months 2 days ago #742

  • vgudenus
  • vgudenus's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 13
  • Karma: 0
hi thanks for the answer .. didnt work out though.. using joomla 3.1 and the tutorial is just for 2.5 (.. dont know though if that is the reason)

secondly there is already a field name = "title_link". After changing the field name to "title_url" in mod_st_content_showcase.xml and modules.php accordingly it still doesn't work.

i see the field "title url" in the basic options of the module but after inserting an url the title still isnt a link.. currently my code looks like that.

mod_st_content_showcase.xml:
<fields name="params">
                        <fieldset name="basic">
                                        ...
                                        ...
                                        ...
                                <field
                                        name="title_link"
                                        type="radio"
                                        default="1"
                                        label="ST_GLOBAL_TITLE_LINK"
                                        description="ST_GLOBAL_TITLE_DESC_LINK_DESC" >
                                        <option value="0">JNO</option>
                                        <option value="1">JYES</option>
                                </field>
                                
                                <field name="title_url" type="text" default="" label="Title url" description="" />
                                

and modules.php like that:
function modChrome_xhtml($module, &$params, &$attribs)
{
        if (!empty ($module->content)) : ?>
                <div class="moduletable<?php echo htmlspecialchars($params->get('moduleclass_sfx')); ?>">
                <?php if ($module->showtitle != 0) : ?>
                        <?php $title_url = $params->get('title_url'); ?>
            <h3><?php if($title_url) { ?> <a href="<?php echo $params->get('title_url');  ?>"> <?php } ?><?php echo $module->title; ?><?php if($title_url) { ?></a><?php } ?></h3>
        <?php endif; ?>           
                        <?php echo $module->content; ?>
                </div>
        <?php endif;
}


do you see any evident mistakes or know what else i could try..
thx
The administrator has disabled public write access.
  • Page:
  • 1
Time to create page: 0.226 seconds
Powered by Kunena Forum