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
How to Automate the Copyright Year
Dec 27, 2024

Learn how to keep your website's copyright year updated automatically in Concrete CMS.

How to change the path of a group of pages
Dec 23, 2024
By myq.

Change the canonical path without breaking things

Bi-directional Express associations
Dec 18, 2024
By myq.

Set up associations between Express entries in both directions

Display Express Data Across Multiple Sites
Dec 17, 2024
By myq.

A guide to configuring Express entities and the Express Entry List block to ensure proper data display across multiple sites.

Customize locale icons
Oct 29, 2024
By myq.

How to customize locale (language region) flags

Concrete CMS Caching Guide
Oct 16, 2024

An overview of types of caching in Concrete and considerations when using them.

Improvements?

Let us know by posting here.