# New Extension for Mental!

**URL:** <https://www.ruby-forum.com/t/new-extension-for-mental/85130>\
**Category:** Radiant CMS\
**Created:** [February 10, 2007, 8:24am UTC](https://www.ruby-forum.com/t/new-extension-for-mental/85130 "2007-02-10T08:24:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![igotimac](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/85f322/32.png) [@igotimac](https://www.ruby-forum.com/u/igotimac)\
**Post date:** [February 10, 2007, 8:24am UTC](https://www.ruby-forum.com/t/new-extension-for-mental/85130/1 "2007-02-10T08:24:28Z")

</div>

I have completed version 001 of my extension.

It is available at: [http://jotapajaro.com/dump/page\_attributes.zip](http://jotapajaro.com/dump/page_attributes.zip)

Be sure to read the README to install, there are some things I wasn’t  
able to do perfectly with the extensions system so I’ve detailed a few  
small changes to make to radiant core in order to support my extension.

These changes reflect a need for some sort of mechanism extensions can  
use to alter the page edit screen. (They are NOT changes I’m suggesting  
for checkin to mental or trunk)

– Details of the features of my extension. –

This extension adds an “Attributes” tab to the edit screen of every  
page. You can add named attributes of different types and assign them  
values, and then do things based on these attributes with r:tags.

The available attributes are:

UploadedFilePageAttribute:

Allows you to upload files for a specific page, and then reference them  
with the tags:

\<r:image attribute=“” /\>  
\<r:upload\_url attribute=“” /\>

StringPageAttribute

Allows you to define content in short strings in addition to page parts.  
can be referenced with that tag:

\<r:string attribute=“” /\>

BooleanPageAttribute

Allows you to add a named checkbox to particular page, then  
check/uncheck it to control the output of these tags:

\<r:if\_att attribute=“attribute\_name”\>…\</r:if\_att\>  
\<r:unless\_att attribute=“attribute\_name”\>…\</r:unless\_att\>

PageLinkPageAttribute

Allows you to specify the url of another page on the site. (Or select  
the url from an auto-completer after typing in a portion of the page’s  
name)

You can then reference linked pages with the tag:

\<r:link\_att attribute=“name” [other attributes…] /\>  
\<r:link\_att attribute=“name”\>…\</r:link\_att\>

– More Features –

I have also added a thing called “Inherit From Page” to this Attributes  
tab. Specifying a page in this box helps to eliminate some duplication  
of code. During page rendering, if a page part referenced by a tag is  
not found for a particular page, then the “inherits from page” link is  
followed and that page part if retrieved from the parent if available.

* * *

If you are looking through my source, please note that there are more  
features I intend to provide with this extension, and they are not all  
fully implemented or explained in this release. (But, also they  
shouldn’t break anything else…)

I look forward to a discussion with the Radiant Core team about what  
could be done to both Radiant and my Extension in order to support it  
without the hacks explained in the README.

thanks,

Jacob
