-
AuthorPosts
-
robnob Friend
robnob
- Join date:
- October 2011
- Posts:
- 104
- Downloads:
- 0
- Uploads:
- 16
- Thanks:
- 18
- Thanked:
- 2 times in 1 posts
March 28, 2012 at 8:58 pm #175525I apologize for asking a lot of questions in a short period of time. (this will be my last)
1. I am curious if there is a way to add the Author’s name to this module? For example display the image, title of article and author of the article. .
2. Also – is there a way to move the text field to overlap the image? (white text)
Basically, i would like to make a sub-module from the current JA contentslider2 and install it under a different name (contentslider3)As seen here..
-
khoand Friend
khoand
- Join date:
- February 2011
- Posts:
- 4500
- Downloads:
- 0
- Uploads:
- 179
- Thanks:
- 169
- Thanked:
- 1166 times in 1060 posts
March 29, 2012 at 4:38 am #4462472. Also – is there a way to move the text field to overlap the image? (white text)
You find the code from /templates/ja_methys/css/mod_jacontentslider.css
div.ja_slidetitle a {
font-weight: normal;
font-size: 150%;
color: #111; < change text to white
}
You replace the code from /templates/ja_methys/css/mod_jacontentslider.cssdiv.ja_slidetitle {
font-family: Georgia,Arial, Helvetica, sans-serif;
}with
div.ja_slidetitle {
font-family: Georgia,Arial, Helvetica, sans-serif;
position: absolute;
top: 70px;
}robnob Friendrobnob
- Join date:
- October 2011
- Posts:
- 104
- Downloads:
- 0
- Uploads:
- 16
- Thanks:
- 18
- Thanked:
- 2 times in 1 posts
March 29, 2012 at 11:33 pm #446398Thanks very much Khoand – that was very helpful.
Do you know #1? how to add the authors name?
khoand Friendkhoand
- Join date:
- February 2011
- Posts:
- 4500
- Downloads:
- 0
- Uploads:
- 179
- Thanks:
- 169
- Thanked:
- 1166 times in 1060 posts
March 30, 2012 at 3:08 pm #446469You replace the code from /templates/ja_methys/html/mod_jacontentslider2/default.php
<?php echo ($params->get( 'link_titles' ) ) ? '<a href="'.$link.'" title="">'.$contn->title.'</a>' : $contn->title;?>
with
<?php $user =& JFactory::getUser($contn->created_by); ?>
<?php echo ($params->get( 'link_titles' ) ) ? '<a href="'.$link.'" title="">'.$contn->title.' - '.$user->name.'</a>' : $contn->title.' - '.$user->name;?>robnob Friendrobnob
- Join date:
- October 2011
- Posts:
- 104
- Downloads:
- 0
- Uploads:
- 16
- Thanks:
- 18
- Thanked:
- 2 times in 1 posts
May 1, 2012 at 8:21 pm #450904Khoand – How do you add a break between the Title and Username? i tried adding a echo /n and it gave me a fatal error??
Also can you link the username to the k2 userpage? or does that require too much coding? Thanks as alwaysrobnob Friendrobnob
- Join date:
- October 2011
- Posts:
- 104
- Downloads:
- 0
- Uploads:
- 16
- Thanks:
- 18
- Thanked:
- 2 times in 1 posts
May 1, 2012 at 8:43 pm #450908also – i was hoping to apply different css to the title/username
Sherlock FriendSherlock
- Join date:
- September 2014
- Posts:
- 11453
- Downloads:
- 0
- Uploads:
- 88
- Thanks:
- 221
- Thanked:
- 2478 times in 2162 posts
May 2, 2012 at 10:50 am #451019<em>@robnob 317016 wrote:</em><blockquote>also – i was hoping to apply different css to the title/username</blockquote>
hi robnob,
what do you meant by “apply different css to the title/username” ? how do we know what css is right for a title/username
robnob Friendrobnob
- Join date:
- October 2011
- Posts:
- 104
- Downloads:
- 0
- Uploads:
- 16
- Thanks:
- 18
- Thanked:
- 2 times in 1 posts
May 2, 2012 at 12:29 pm #451031Hi Dat Hoang,
In the image above – you will notice that the Title and User are from the same php script.
I guess i am wondering how to separate them in two scripts so i can apply two separate CSS settings.
1. for a larger texted title and 2. a second line with smaller font for the User (also linked to the users K2 profile)I hope that clarifies. Thank you.
<em>@Dat Hoang 317150 wrote:</em><blockquote>hi robnob,
what do you meant by “apply different css to the title/username” ? how do we know what css is right for a title/username</blockquote>
Sherlock FriendSherlock
- Join date:
- September 2014
- Posts:
- 11453
- Downloads:
- 0
- Uploads:
- 88
- Thanks:
- 221
- Thanked:
- 2478 times in 2162 posts
May 3, 2012 at 4:14 am #451182Hi robnob,
you can replace pervious code
[PHP]
<?php $user =& JFactory::getUser($contn->created_by); ?>
<?php echo ($params->get( ‘link_titles’ ) ) ? ‘<a href=”‘.$link.'” title=””>’.$contn->title.’ – ‘.$user->name.'</a>’ : $contn->title.’ – ‘.$user->name;?>
[/PHP]By the below that would link username to the user page
[PHP]
<?php $user =& JFactory::getUser($contn->created_by);
require_once (JPATH_SITE.DS.’components’.DS.’com_k2′.DS.’helpers’.DS.’route.php’);
require_once (JPATH_SITE.DS.’components’.DS.’com_k2′.DS.’helpers’.DS.’utilities.php’);
$userLink = JRoute::_(K2HelperRoute::getUserRoute($user->id));?>
<?php echo ($params->get( ‘link_titles’ ) ) ? ‘<a href=”‘.$link.'” class=”ctitle” title=””>’.$contn->title.'</a> – <a class=”cuser” href=’.$userLink.’> ‘.$user->name.'</a>’ : $contn->title.’ – ‘.$user->name;?>[/PHP]
Also now you have two separate css class for title and username those are ctitle and cuser you can define different css to the title/username via those class.
1 user says Thank You to Sherlock for this useful post
robnob Friendrobnob
- Join date:
- October 2011
- Posts:
- 104
- Downloads:
- 0
- Uploads:
- 16
- Thanks:
- 18
- Thanked:
- 2 times in 1 posts
May 3, 2012 at 7:56 pm #451301THANK YOU! By Adding the 2 new Classes (cuser/ctitle)
Do i have to manually add them to the CSS file or should they auto generate?robnob Friendrobnob
- Join date:
- October 2011
- Posts:
- 104
- Downloads:
- 0
- Uploads:
- 16
- Thanks:
- 18
- Thanked:
- 2 times in 1 posts
May 5, 2012 at 12:40 am #451502Sherlock – I love the php script – but i am having a ton of trouble applying CSS settings to a A CLASS… should i break this up and put it into two DIV CLASS? Sorry for my lack of experience.
<em>@Sherlock Holmes 317357 wrote:</em><blockquote>Hi robnob,
you can replace pervious code
[PHP]
<?php $user =& JFactory::getUser($contn->created_by); ?>
<?php echo ($params->get( ‘link_titles’ ) ) ? ‘<a href=”‘.$link.'” title=””>’.$contn->title.’ – ‘.$user->name.'</a>’ : $contn->title.’ – ‘.$user->name;?>
[/PHP]By the below that would link username to the user page
[PHP]
<?php $user =& JFactory::getUser($contn->created_by);
require_once (JPATH_SITE.DS.’components’.DS.’com_k2′.DS.’helpers’.DS.’route.php’);
require_once (JPATH_SITE.DS.’components’.DS.’com_k2′.DS.’helpers’.DS.’utilities.php’);
$userLink = JRoute::_(K2HelperRoute::getUserRoute($user->id));?>
<?php echo ($params->get( ‘link_titles’ ) ) ? ‘<a href=”‘.$link.'” class=”ctitle” title=””>’.$contn->title.'</a> – <a class=”cuser” href=’.$userLink.’> ‘.$user->name.'</a>’ : $contn->title.’ – ‘.$user->name;?>[/PHP]
Also now you have two separate css class for title and username those are ctitle and cuser you can define different css to the title/username via those class.</blockquote>
robnob Friendrobnob
- Join date:
- October 2011
- Posts:
- 104
- Downloads:
- 0
- Uploads:
- 16
- Thanks:
- 18
- Thanked:
- 2 times in 1 posts
May 6, 2012 at 4:03 am #451648Can anybody answer this question? I need to add two CSS styles, but i cannot figure out how to give CSS settings to a CLASS and not a DIV CLASS… if that makes sense :-[ Thank you
Sherlock FriendSherlock
- Join date:
- September 2014
- Posts:
- 11453
- Downloads:
- 0
- Uploads:
- 88
- Thanks:
- 221
- Thanked:
- 2478 times in 2162 posts
May 7, 2012 at 2:48 am #451748<em>@robnob 317942 wrote:</em><blockquote>Can anybody answer this question? I need to add two CSS styles, but i cannot figure out how to give CSS settings to a CLASS and not a DIV CLASS… if that makes sense :-[ Thank you</blockquote>
hi robnob,
I am sorry for this late reply, I am not sure which css settings you want to apply for those a tags, if you want you can wrap those a tags by a div tag, try with this code
[PHP] <?php echo ($params->get( ‘link_titles’ ) ) ? ‘<div class=”ctitle”><a href=”‘.$link.'” title=””>’.$contn->title.'</a></div> – <div class=”cuser”><a href=’.$userLink.’> ‘.$user->name.'</a></div>’ : $contn->title.’ – ‘.$user->name;?>[/PHP]Instead of this code as current
[PHP] <?php echo ($params->get( ‘link_titles’ ) ) ? ‘<a href=”‘.$link.'” class=”ctitle” title=””>’.$contn->title.'</a> – <a class=”cuser” href=’.$userLink.’> ‘.$user->name.'</a>’ : $contn->title.’ – ‘.$user->name;?>[/PHP]1 user says Thank You to Sherlock for this useful post
robnob Friendrobnob
- Join date:
- October 2011
- Posts:
- 104
- Downloads:
- 0
- Uploads:
- 16
- Thanks:
- 18
- Thanked:
- 2 times in 1 posts
May 8, 2012 at 12:56 am #451926Worked like a charm Sherlock (except that i can’t get the – or text Written By) in front of the cuser div.
Any chance i can ask one more php type question?
How would i add the K2 Category?
For example (in the image below) if i replaced the cusername “jason falb” with category name – like NBAThanks so much!
<em>@Sherlock Holmes 318062 wrote:</em><blockquote>hi robnob,
I am sorry for this late reply, I am not sure which css settings you want to apply for those a tags, if you want you can wrap those a tags by a div tag, try with this code
[PHP] <?php echo ($params->get( ‘link_titles’ ) ) ? ‘<div class=”ctitle”><a href=”‘.$link.'” title=””>’.$contn->title.'</a></div> – <div class=”cuser”><a href=’.$userLink.’> ‘.$user->name.'</a></div>’ : $contn->title.’ – ‘.$user->name;?>[/PHP]Instead of this code as current
[PHP] <?php echo ($params->get( ‘link_titles’ ) ) ? ‘<a href=”‘.$link.'” class=”ctitle” title=””>’.$contn->title.'</a> – <a class=”cuser” href=’.$userLink.’> ‘.$user->name.'</a>’ : $contn->title.’ – ‘.$user->name;?>[/PHP]</blockquote>
Sherlock FriendSherlock
- Join date:
- September 2014
- Posts:
- 11453
- Downloads:
- 0
- Uploads:
- 88
- Thanks:
- 221
- Thanked:
- 2478 times in 2162 posts
May 8, 2012 at 1:56 am #451931Hi robnob,
you no longer want usernames there ? so which link the category name will refer to ?
<blockquote>
Any chance i can ask one more php type question?
How would i add the K2 Category?
For example (in the image below) if i replaced the cusername “jason falb” with category name – like NBA
</blockquote>AuthorPostsThis topic contains 17 replies, has 3 voices, and was last updated by Sherlock 12 years, 6 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum
Jump to forum