Forum: Radiant CMS Use sub folder url with share_layouts

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
28869a509b11eb77375d066fce22fcc8?d=identicon&s=25 Vincent Pérès (vincentp)
on 2008-12-15 15:53

I'm using share_layouts in a page '/project' which is using a layout
I created an extension, with routes, controllers etc. to map the project
Everything is working, the 'part' is display thanks to the layout.

Then, I created a new page '/project/list'. I maped it again etc., but
the final display is strange : I got the content of the 'project' page
(only from database not from my view), the content of my new page and
the view of my new page.
In fact the normal page + '/project' content.

Is it normal or did I forgot something?

5d7970d97d3cd33fcd85696b87a4611e?d=identicon&s=25 Chris Parrish (cparrish)
on 2008-12-15 21:55
(Received via mailing list)
Hello Vincent.  I've been working with ShareLayouts a bit recently,
maybe I can help.  Can you give more details, though?

I'd like to know:

    * Are you using the latest version of ShareLayouts from GitHub?
    * Can you provide your route(s)?
    * Can you provide any of your actions/views (enough to show what's
      using what).
    * It sounds like you're using an Application Page in Radiant with
      the URL of /project/ is this correct? Is there anything fancy
      there?  Do you have an Application Page at /project/list too?

28869a509b11eb77375d066fce22fcc8?d=identicon&s=25 Vincent Pérès (vincentp)
on 2008-12-15 23:43
Hello, thanks ! I will give you more informations :

I created two pages :
Projects => /projects (with body content 'Here is Projects')
  Create => /projects/new (with body content 'Here is new project')

Then, I created a new extension with the following routes :
map.with_options(:controller => 'projects') do |project|
  project.project_index    '/projects', :action => 'index'
  project.project_new      '/project/new', :action => 'new'

The controller project is a simple controller like that :
class ProjectsController < ApplicationController
  radiant_layout ''
  skip_before_filter :verify_authenticity_token

  def index

  def new


In the two view, I have something like :
- content_for :extension do
  content for project...

- content_for :extension do
  content for new project...

Back to the backend, I'm using a layout which include parts 'body' and

Now with share_layouts this is my result :

Here is Projects
content for project...

Here is Projects
content for new project...

The way is normal for the first link, but the page content of the second
come from the first one.
Let me know if you need more informations.
I'm not using fancy extension except the vhost extension (for multi

Thanks !
28869a509b11eb77375d066fce22fcc8?d=identicon&s=25 Vincent Pérès (vincentp)
on 2008-12-16 16:36
I tried the last version of share_layouts on github but I got the same
problem... maybe it's a mistake of one of my extension.
I will check in a new Radiant project later.

I have another problem with share_layouts. I created a page and add some
content :

<h2><r:title /></h2>
<br />

<r:content part="query" />
<r:flash id="form_project_query" />
<r:form id="project" action="/project-add-query"
  <r:text_field id="query" label="Add a new query" validations="filled"
  <input type="hidden" name="project[project_id]" value="<r:content
part="project_id" />" />
  <r:submit value="Add" />
  <r:notice_required_fields />
<br />

And in my view :
- content_for :title do
  = @project.topic

- content_for :project_id do

- content_for :query do
  - @project.queries.each do |query|
    %li= query.search_string

It is working in development mode but not in production. What could
change between both of them?

Thanks !
7a82611d687dad24e11ffddf6b348f29?d=identicon&s=25 Christian Vetter (Guest)
on 2008-12-16 17:50
(Received via mailing list)
Hi Vincent,
I've been using Radiant for just a few days now, but I recall reading
something about inheriting content from parent pages through the page
parts. If I get your descriptions right, _part_ of the content from
/projects is rendered in subpages, so I guess that might indeed result
from said feature. I'd have liked to look it up for you, but I'm in a
bit of a hurry.

Hope this helps

-------- Original-Nachricht --------
5d7970d97d3cd33fcd85696b87a4611e?d=identicon&s=25 Chris Parrish (cparrish)
on 2008-12-16 19:03
(Received via mailing list)
Christian, this is true -- sortof.  I recently submitted some patches to
Sean that have been rolled into shared_layouts.  One of these changes
now lets you create a sub-page within Radiant like Vincent describes.
If you fail to create a sub-page, then the old behavior -- the one you
described -- prevails.  This way you can use the sub-page's breadcrumbs,
title, and, page parts.

This is also why I wanted to know if Vincent was using this latest
version of shared_layouts.

Vincent, try pulling the latest version and see if it fixes things for

28869a509b11eb77375d066fce22fcc8?d=identicon&s=25 Vincent Pérès (vincentp)
on 2008-12-29 17:12
I tried the last version of share_layouts but I got the same errors.
So, I decided to test it from scratch with a fresh radiant 0.6.9,
share_layouts, and my projects extension. It's working, but now I got
sometimes another error.

Example : I created a /project page and a layout with the following
content : <r:content page="test" /> (in both of them, it's for a test).
In production mode, it's working, but if I add some controller /
extension, it's not working (the content of the page is not display, but
the content from the layout is display, so it's realy strange). If I
add/remove another controller / extension it's now working... I don't
understand, because it's the case with any controller / extension. If
I'm running in development mode, everything is working fine.

Is it a cache problem or something like that?
Anyone had the same error?

28869a509b11eb77375d066fce22fcc8?d=identicon&s=25 Vincent Pérès (vincentp)
on 2009-01-04 20:39

I found new stuff linked (I hope) to my bug with share_layouts.

In the rails page model, I did a debug in the console :
def build_parts_from_hash!(content)
    content.each do |k,v|
      puts "$$$$$$$$ part : " + k.to_s
      puts "$$$$$$$$ part content : " + v
      (part(k) || => k.to_s)).content = v

And this is my result :

$$$$$$$$ part : my_part
$$$$$$$$ part content :
I'm in the part
$$$$$$$$ part : body
$$$$$$$$ part content :
WARNING: You're using the Ruby-based MySQL library that ships with
Rails. This library is not suited for production. Please install the
C-based MySQL library instead (gem install mysql).

I'm using mysql with xampp, the problem is maybe coming from this

I tried to install the mysql gem, but I have some mysql package missing
checking for mysql_query() in -lmysqlclient... yes
checking for mysql_ssl_set()... yes
checking for mysql.h... no
checking for mysql/mysql.h... no
*** extconf.rb failed ***

I will try to install mysql from scratch.
But is it normal, do you have any idea?

682233f4f5b894b2d328b0c98d0d7582?d=identicon&s=25 Jeffrey Jones (Guest)
on 2009-01-04 22:47
(Received via mailing list)
You are missing the mysql development headers. Depending on your
distribution they come in various packages. Something along the lines of
mysql-devel or something like that

This topic is locked and can not be replied to.