External Links may not do what I expected or hoped.

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.
Post Reply
User avatar
wakewatcher
Forum Members
Forum Members
Posts: 149
Joined: Fri Dec 28, 2007 12:33 am

External Links may not do what I expected or hoped.

Post by wakewatcher »

I promise I did a search (but I may have a search term disability) We are in the process of moving an old hand coded web site to a cmsms installation. For the transition I was just hoping to be able to use the 'external link' (or whatever) so that our old web page shows up in the content frame of cmsms. Instead it religiously overwrites the entire page or opens in a new frame (depending on the setting chosen). But really all I want is it to open up where fresh content would be had we re-written the content. -thx-
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1803
Joined: Wed Feb 25, 2009 4:25 am

Re: External Links may not do what I expected or hoped.

Post by DIGI3 »

External link is exactly that, a link to a new page or site. If you want to embed a file into your content or template (make sure you know what you're doing here.. is it an iframe you're after, or are you going to parse it to remove the <head>, etc?) you can use {fetch file='path/yourfile.ext'}

http://www.smarty.net/docs/en/language. ... .fetch.tpl
User avatar
wakewatcher
Forum Members
Forum Members
Posts: 149
Joined: Fri Dec 28, 2007 12:33 am

Re: External Links may not do what I expected or hoped.

Post by wakewatcher »

Thanks. Yes that makes sense. It's called what it is. Thanks so much for the pointer. {fetch} looks promising. I looked at the reference page and it looked very straight forward. For example to display yahoo.com into my page it appeared that the smarty command would be {fetch file='http://www.yahoo.com'}. I thought it would put it in the "content space" (iframe?) so maybe some scroll bars would keep it contained but what it does is breach the boundaries of cmsms page. Again I'm not looking for this as a long term fix but just an interim while we convert the pages to more typical cmsms.
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1803
Joined: Wed Feb 25, 2009 4:25 am

Re: External Links may not do what I expected or hoped.

Post by DIGI3 »

If the content in the old side is in a div with an id or class, or otherwise easy to differentiate, you could capture the fetch to a variable, then parse that through a regex to discard everything outside that div (or whatever). Smarty has some built-in regex functions, shouldn't be too hard to figure out.
User avatar
wakewatcher
Forum Members
Forum Members
Posts: 149
Joined: Fri Dec 28, 2007 12:33 am

Re: External Links may not do what I expected or hoped.

Post by wakewatcher »

That sounds like a plan. Thanks for the tips and pointers. That gives me something to work on.
Post Reply

Return to “CMSMS Core”