Function for forwarding in page_params plugin (CMSimple_XH)

Discussions and requests related to new CMSimple features, plugins, templates etc. and how to develop.
Please don't ask for support at this forums!
johnjdoe
Posts: 571
Joined: Tue May 20, 2008 6:32 am

Function for forwarding in page_params plugin (CMSimple_XH)

Post by johnjdoe » Wed Sep 23, 2009 6:12 am

Hi,

I know that it is perhaps a little bit late (just before the final version of CMSimple_XH) but I often use the following code in my projects:

Code: Select all

#CMSimple header('Location:http://www.anotherpage.com'); #
Should page_params not include a possibility to forward to another internal page / external site?

Gerd

Gert
Posts: 3078
Joined: Fri May 30, 2008 4:53 pm
Location: Berlin
Contact:

Re: Weiterleitungsfunktion in page_params

Post by Gert » Wed Sep 23, 2009 6:40 am

Good Idea, I think that will cause less of Supports in the forum.
Last edited by Gert on Wed Sep 23, 2009 6:43 am, edited 1 time in total.
Gert Ebersbach | CMSimple | Templates - Plugins - Services

Holger
Site Admin
Posts: 3470
Joined: Mon May 19, 2008 7:10 pm
Location: Hessen, Germany

Re: Function for forwarding in page_params

Post by Holger » Wed Sep 23, 2009 9:02 am

Nice idea, even if I think that this is the job of the toc() function.
With Jens' advancedtoc.php it's easy to integrate external links.
But on the other side it's not easy to integrate and to customise.
I don't think that there're compatibility problems like with the hide-function. So it's IMO a good idea to integrate it.

Holger

Gert
Posts: 3078
Joined: Fri May 30, 2008 4:53 pm
Location: Berlin
Contact:

Re: Function for forwarding in page_params plugin (CMSimple_XH)

Post by Gert » Thu Sep 24, 2009 6:48 am

I think, that's independent from CMSimple_XH. The Pluginloader, meta_tags and page_params will be published outside of CMSimple_XH, everybody can update it if he want.

So we can publish CMSimple_XH 1.0 even if that feature still is not included.
Gert Ebersbach | CMSimple | Templates - Plugins - Services

johnjdoe
Posts: 571
Joined: Tue May 20, 2008 6:32 am

Re: Function for forwarding in page_params plugin (CMSimple_XH)

Post by johnjdoe » Thu Sep 24, 2009 9:08 am

Gert wrote: So we can publish CMSimple_XH 1.0 even if that feature still is not included.
Hmm, I think it would be better to release the final WITH this important feature. Other where we said that page_params is a part of CMSimple_XH.

What do the developper of page_params think about my proposition? Could it be implemented without problems and what could be the delay?

Gert
Posts: 3078
Joined: Fri May 30, 2008 4:53 pm
Location: Berlin
Contact:

Re: Function for forwarding in page_params plugin (CMSimple_XH)

Post by Gert » Thu Sep 24, 2009 9:22 am

johnjdoe wrote:Other where we said that page_params is a part of CMSimple_XH.
This diskuss is not new. I also think, meta_tags and page_params are not good without CMSimple_XH, because the pagedata.php is not included in the backup on the server and not downloadable in settings.
Gert Ebersbach | CMSimple | Templates - Plugins - Services

Holger
Site Admin
Posts: 3470
Joined: Mon May 19, 2008 7:10 pm
Location: Hessen, Germany

Re: Function for forwarding in page_params plugin (CMSimple_XH)

Post by Holger » Thu Sep 24, 2009 10:09 am

Gert wrote:I also think, meta_tags and page_params are not good without CMSimple_XH, because the pagedata.php is not included in the backup on the server
That's the point. But to be sure to have a full-backup the pluginloader should be hooked on CMSimple_XH.
Maybe by a new constant, set in cms.php...

... on the other side: no risk, no fun :P

Holger

Martin
Posts: 346
Joined: Thu Oct 23, 2008 11:57 am
Contact:

Re: Function for forwarding in page_params plugin (CMSimple_XH)

Post by Martin » Thu Sep 24, 2009 12:06 pm

I'm not so sure wether this is a good idea or not. On the one hand: These redirections are some kind of external links. Why should they be handled here? As Holger wrote, it's a job, that should be done by the toc-functions. On the other hand: It could be much more easily integrated here. It would be done within 15 min. (+ the translation work of course). So why think about it too long?

But anyway, for what purposes do you use redirections? I dont use them often, simply because I don't like beeing redirected myself. When I needed a tight integration of an external link to the menu, I was always lucky: It had to be the last (or first) element of the top level navigation. So the problem could be solved with a simple str_replace('</ul>', '<li ...><a...>Text</a></li></ul>', toc()); in the template.

But if there are more complex needs for the relocation, here is a small how-to:
  • at the beginning of page_param/index.php add

    Code: Select all

    $pd_router -> add_interest('header_location'); 
  • within loop at the bottom add something like

    Code: Select all

    if(trim($values['header_location']) !== ''){ 
         $sc = fsockopen($values['header_location']);
         if($sc){close($sc);      
                $c[$key]  = '#CMSimple header("Location:http://'. $values['header_location'] .'"); #';
         }
     } 
  • add an input field named 'header_location' to the form in page_params/page_params_view.php
  • add tooltip (hint_header_location) and label to the language files
I could do it on monday, but if you are in a hurry and want to test it right now, feel free to do it! It's really no big deal to add additional "page params". Maybe some variable for an header image that can be used in the template?

Martin

Gert
Posts: 3078
Joined: Fri May 30, 2008 4:53 pm
Location: Berlin
Contact:

Re: Function for forwarding in page_params plugin (CMSimple_XH)

Post by Gert » Thu Sep 24, 2009 12:21 pm

Martin, you are right. The toc is an internal navigation, there should not be external Links in it.

We should not support such a cheese (that's my English for german users :lol: )

Some users could be confused, if there are some external links into the toc. I also will change that on our sites on cmsimple-xh.de, I will set a newsbox under the toc with the Links to the legal notices and the team-pages in the German installation.
Last edited by Gert on Thu Sep 24, 2009 12:33 pm, edited 4 times in total.
Gert Ebersbach | CMSimple | Templates - Plugins - Services

Holger
Site Admin
Posts: 3470
Joined: Mon May 19, 2008 7:10 pm
Location: Hessen, Germany

Re: Function for forwarding in page_params plugin (CMSimple_XH)

Post by Holger » Thu Sep 24, 2009 12:28 pm

+1

But we should start to collect Martins snippets to provide some little HowTo's...

Holger

Post Reply