{NEWCATID}

Post custom hacks and enhancements for phpwcms here only. Maybe some of these things will be included in official release later.
Jakim José
Posts: 77
Joined: Fri 18. Feb 2005, 18:55
Location: Portugal/Aveiro

Only "30 caracters" to the article title links

Post by Jakim José »

How to do to appear only "x" letters in article links?

Example:
Only 30 caracters

The original titles are:
- "Michael Jordan is on fire, but chicago bulls loose".
- "Chicago Bulls loose the championship on the last minute".

The desired result is:
2005/02/23 - Michael Jordan is on fire, but ...
2005/02/24 - Chicago Bulls loose the cham ...
User avatar
isac
Posts: 410
Joined: Tue 18. Nov 2003, 13:13
Location: Portugal
Contact:

Re: new improve ?

Post by isac »

snezko wrote:is it possible change the second variable in this tag by something more dynamic ? for example CURRENT how is it in menu ?

because than i need only one implementation of tag in the template for all the web.
That's what i'm waiting for soo loooong
User avatar
Kosse
Posts: 1066
Joined: Thu 9. Sep 2004, 12:08
Location: Brussels, Belgium
Contact:

Post by Kosse »

That's what i'm waiting for soo loooong
It has been there for long too ... didn't see this post before :roll:

look into config/phpwcms/conf.template_default.inc.php
find // new articles (around line 223)

Code: Select all

// new articles
$template_default["news"]["before"]			= '<div class="news">';
$template_default["news"]["after"]			= '</div>';
$template_default["news"]["link_before"]	= '<p>';
$template_default["news"]["link_after"]		= '</p>';
$template_default["news"]["link_symbol"]	= '';
$template_default["news"]["link_target"]	= '';
$template_default["news"]["link_length"]	= 0; //if 0 no limit
The ["link_length"] gives you that you can put 30... or whatever.

Code: Select all

$template_default["news"]["link_length"]	= 30; //if 0 no limit
Cheers
User avatar
isac
Posts: 410
Joined: Tue 18. Nov 2003, 13:13
Location: Portugal
Contact:

Post by isac »

@kosse

you quote the wrong post :D
you should quote Jakim José
How to do to appear only "x" letters in article links?

Example:
Only 30 caracters

The original titles are:
- "Michael Jordan is on fire, but chicago bulls loose".
- "Chicago Bulls loose the championship on the last minute".

The desired result is:
2005/02/23 - Michael Jordan is on fire, but ...
2005/02/24 - Chicago Bulls loose the cham ...
It's an different thing what I want!

Let's say you have category NEWS with 5 articles in it:

+ NEWS
++ article 1
++ article 2
++ article 3
++ article 4
++ article 5

If you use this RP like a menu (like i do) when you go page 2 (article 2)
you should get the same menu but with current link in different style

+ NEWS
++ article 1
++ article 2
++ article 3
++ article 4
++ article 5

You know how to do it? post here and you be my hero (kidding)

Thanks
Isac
User avatar
Kosse
Posts: 1066
Joined: Thu 9. Sep 2004, 12:08
Location: Brussels, Belgium
Contact:

Post by Kosse »

isac wrote:@kosse

you quote the wrong post :D
you should quote Jakim José

...

You know how to do it? post here and you be my hero (kidding)

Thanks
Isac
:oops: :oops: sorry, my bad (broke my glasses yesterday <-- funny part is that it's true :? ...

Well, as for the RT used as menu... mmmm...

1) half a solution: maybe just a:link with css... but that would apply to all the page, except if u put a special a with a class to your menu, then at least it would highlight the article you clicked on (but it's half a solution because if u click more then one, you have 2 a:linked highlighted).

Maybe...
2) I thought about this before because I stummmmbled on the same thing, so what I thought is a bit complicated but might work (but never did it and maybe there's an easier solution): a little php code that gets the url, something like $QUERY_STRING then compare this string (var1) to the a href of your link(var2). If var1 = var2 then apply another css if not, do nothing. Off course, in order to get this working we have to modify function get_new_articles in front.func.inc.php ... anyway not an easy job :? but ... possible, if I try I'll spend hours and hours on it (maybe finding a solution) but honestly my php skills are too few to be of a real help. Maybe some guys here can do that or have better solutions?
So, I guess I won't be your hero :D :cry:

Good luck
Cheers
User avatar
isac
Posts: 410
Joined: Tue 18. Nov 2003, 13:13
Location: Portugal
Contact:

Post by isac »

Sorry for your glasses.
I really hope someone develop an RT for this purpose! I think it's very usefull for sub article navigation. Don't you?
POR :D TUGAL
Post Reply