Page Template sample which just redirect to the page (5.7.x)

This is a community-contributed tutorial. This tutorial is over a year old and may not apply to your version of Concrete CMS.
Dec 29, 2015

Sometime, "external link" doesn't fulfill your requirement for the page. You may want to display thumbnail image, additional page attribute such as topic and selector attributes to display the categories of the page.

This tutorial explains how to set-up redirect-only page with more page attributes option by creating redirect-only page template and page type in your theme.

(You may also want to customize your Page List and/or Autonav Blocks if you want to avoid additional redirect requests)

Disclaimer

I hold no responsibility over any damages caused by using this script.

Requirement

This uses Page Selector Attribute

https://marketplace.concretecms.com/marketplace/addons/page-selector-attribute1/

How to set-it up

Currently, if you are the site editor who can see the Concrete CMS toolbar on top, you won't get redirected but stayed on the page so that you'll be able to edit.

Basic Set-ups

  • Copy and paste redirect.php below and create a page template under your theme.
  • Create a page type. Add composer elements to enter page name, url and the following page attributes.

external_page Page Selector Attribute

Create a page selector attribute called "external_page"

Or comment out or delete from line 6-10.

external_link Text Attribute

Create a text page attribute called external_link, which you enter URL.

If both externap_page and external_link was entered, externap_page will be used.

Hint: You could add File Attributes

You could add File Attribute to have them download the file.

Code Sample

Code is available on the gist

https://gist.github.com/katzueno/146261d07111ad23fe44

Recent Tutorials
Setting addon/theme version compatibility in the marketplace
Jan 9, 2024

For developers worn out with setting the latest addon or theme version manually across too many core versions, here is a JavaScript bookmarklet to do it for you.

How to get the locale of a page
Jan 8, 2024
By mandako.

Now, why don't we just have a getLocale() method on Page objects beats me, but here's how you work around it

Using a Redis Server
Jun 16, 2023
By mlocati.

How to configure Concrete to use one or more Redis servers to persist the cache.

Using the Concrete Migration Tool Addon
Apr 27, 2023

How to use the Concrete CMS Migration Tool

How To Add Page Last Updated To Your Concrete CMS Pages
Mar 7, 2023

Concrete CMS has a page attribute you can add to a global area called "Page Date Modified." Here's how to add it

How To Exclude Subpages from Navigation
Dec 24, 2022

How to exclude subpages from navigation - useful for a news or blog link in your main navigation where you don't want all the subpages to appear in a drop down menu.

Improvements?

Let us know by posting here.