News 2.0 & cms_selflink

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
pinthenet

Re: News 2.0 & cms_selflink

Post by pinthenet »

OK partial success! I realised I was misunderstanding the sequence so tried the eval trick again and it works in 11.1 & 11.2, but it still doesn't work with 11.2 without the eval.

Question - if I do a fresh install will CMSMS recognise an existing DB? Otherwise I assume I have to recreate everything.

John
User avatar
petert
Power Poster
Power Poster
Posts: 282
Joined: Wed Feb 09, 2005 9:30 pm

Re: News 2.0 & cms_selflink

Post by petert »

after fixing the latest svn checkout I got it to work too (with the eval hack though)

thnx
Mambo sucks, that's why I am here.
Now they call it Joomla, but it still sucks!

CMSMS rules!
westis

Re: News 2.0 & cms_selflink

Post by westis »

pinthenet wrote: OK partial success! I realised I was misunderstanding the sequence so tried the eval trick again and it works in 11.1 & 11.2, but it still doesn't work with 11.2 without the eval.
Yeah, the eval has to be there... at least for now, as I understand it.

Question - if I do a fresh install will CMSMS recognise an existing DB? Otherwise I assume I have to recreate everything.
You can do a fresh install and uncheck the box during the installation that asks if you want to overwrite existing tables. That way your old tables are not overwritten.
iNSiPiD

Re: News 2.0 & cms_selflink

Post by iNSiPiD »

The eval solution is not a hack, it's just appropriate.

It works just fine for me. Make sure your pages are using the default News templates.

If it's still not working, try a fresh install and then copy the templates above.

And try to bear in mind that this is a free support forum for an opensource application.

Manners and patience, people. Manners and patience.
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm

Re: News 2.0 & cms_selflink

Post by Ted »

Yeah, there is no way around the eval situation.  It's just the way that smarty handles things.  If every variable was being parsed by smarty for more tags, it would slow down the system incredibly.

There are ways to process all of the output from smarty later on, but that just becomes a mess and causes other issues.  Sadly, this is the cleanest I can make it for now.
User avatar
petert
Power Poster
Power Poster
Posts: 282
Joined: Wed Feb 09, 2005 9:30 pm

Re: News 2.0 & cms_selflink

Post by petert »

wishy wrote: Yeah, there is no way around the eval situation.  It's just the way that smarty handles things.  If every variable was being parsed by smarty for more tags, it would slow down the system incredibly.
I hoped that when I was told that this was fixed it was a more transparent solution, a 'behind-the'scenes' eval would do fine.
wishy wrote: There are ways to process all of the output from smarty later on, but that just becomes a mess and causes other issues.  Sadly, this is the cleanest I can make it for now.
I already use the e-mail postprocessor, the tag replacement post and a few others. I wouldn't mind adding an extra one to achieve this great extra functionality

(and btw I am very very gratefull for all the things you and all the others in the development team do. Maybe we should have a cmsmadesimple developpers appreciation day soon?)
Mambo sucks, that's why I am here.
Now they call it Joomla, but it still sucks!

CMSMS rules!
magicpio
Forum Members
Forum Members
Posts: 30
Joined: Mon Dec 05, 2005 7:54 pm

Re: News 2.0 & cms_selflink in CMSMS 0.13

Post by magicpio »

Hello,
sorry to revive this discussion, but I have the following problem:

I have a news entry with empty summary. In the news content I want to link to a page in an external module (Singapore Gallery).
Using cms_selflink works until I want to refer to a particular "sub-page".
To be precise, I want to call this complete path:

http://192.168.1.99/cmsmadesimple/index ... y=./Diving

When I place the tag like this, it works, but its of course not above full URL:
{cms_selflink page="Gallery"}

But the following does not work (nothing is displayed in the news text):
{cms_selflink page="Gallery&gallery=./Diving"}
EDIT: This doesn´t work because we´re searching inside the database for the pagename, and a page named "Gallery&gallery=./Diving"
doesn´t exist. only "Gallery" exists.

Also this does not work, the tag is being processed correctly, but the resulting anchor is not recognised as a link, but shows up as clear text:
diving gallery

I was also playing around with option "more", and I´ve replaced "&" with "&" (although this shouldn´t be the problem), but all without success.
Btw: what does "more" do at all?
EDIT: Ok,it is for additional parameters inside , and will be attached after the page link, separated from this by a space.
So no use for me.

EDIT: So above wisdom still leaves open, why
diving gallery
doesn´t work. Should I place the link text in between "", such as "diving gallery"? Will try .....

Do you have a solution?

Thanks for help.

Pio
Last edited by magicpio on Sun Aug 13, 2006 12:14 pm, edited 1 time in total.
magicpio
Forum Members
Forum Members
Posts: 30
Joined: Mon Dec 05, 2005 7:54 pm

Re: News 2.0 & cms_selflink

Post by magicpio »

Reason, why I don´t arrive in adding additional parameters to a URL is because FCK Editor and TinyMCE are crap!
Strong words, I know! However, if someone can explain to me, how to insert the following URL construct
diving gallery
using one of those editors, I might change my mind. I´ve tried editing in HTML source mode, but
to me it looks as if both editors (or is it smarty?) just try to process this text somehow and cripple it instead.

Ok, after studying the php script I can think of 3 solutions:

1) Use an external or non crippling editor (didn´t try this)
2) Directly edit the database entry (didn´t try that either)
3) Enhance the php script for cms_selflink (%cms root%/plugins/function.cms_selflink.php)
    This is, what I did.
    Basically I added a new parameter (urlparam), which is concatenated directly to the variable $url.

Find the following line:
$result .= $label.'<a href="'.$url.'"';

Between the
else
{

and above line just insert the following code:
if (isset($params['urlparam']))
{
$url .= $params['urlparam'];
}


Now you can insert a tag like this into a news entry:
{cms_selflink page="Gallery" urlparam="&gallery=./Diving" text="diving gallery"}

Enjoy!

Pio
iNSiPiD

Re: News 2.0 & cms_selflink

Post by iNSiPiD »

That's a terrific idea and such a simple patch. I wonder if this would also solve the current problem with linking to #anchor style URLs within a page.

Dev Team?
magicpio
Forum Members
Forum Members
Posts: 30
Joined: Mon Dec 05, 2005 7:54 pm

Re: News 2.0 & cms_selflink

Post by magicpio »

It does work in the direction

1) Normal page onto news summary page
In a normal page put this tag:
{cms_selflink page="News" urlparam="#newsareuse" text="News Areuse summary"}
and in the news details (I didn´t test with news summary, I usually leave it empty) switch directly into html (=source) mode
and enter this:
News Areuse anchor

2) From news summary or news detail onto normal page
Follow instructions above, but inverted.
Place the following tag in the news summary or news detail:
{cms_selflink page="Main" urlparam="#mainanchor" text="Back to main page second paragraph"}
and in a normal page:
Main page anchor second paragraph

3) Normal page onto news detail page
This does not work, because the URL onto a news detail page is not reffered to as "page=" but as "mact=".
I guess this is a different table in the database, thus requires an additional check and database request in the
php script function.cms_selflink.php.
It should be easy enough to integrate though.

Attention! Anchor names are case sensitive, so "mainanchor" is not the same as "MainAnchor"!

Enjoy more ...

Pio
Locked

Return to “CMSMS Core”