If anybody is interested, I never managed to pull in the field (still
not sure why), but got the dynamic name working by simply using the
variable I was calling in the function (not sure why I didn't think of
that before!

Relevant code looks like this:

// declare feed function:
function feed($name = null) {

$this->set
      (
        'channel',
        array
        (
        'title' => $name
        )
      );

On May 22, 7:07 pm, number9 <[email protected]> wrote:
> Many thanks for replying.
>
> I can confirm that it works for me as well so thankyou very much!
>
> Only problem is, while I can assign a string as a variable no problem,
> I'm having trouble retrieving the data.
>
> It is located in a "posts controller", and I am looking for the "name"
> field from the category table as the dynamic title.
>
> I have tried all the usual ways but nothing is getting outputted, (I
> have included var $uses = array('Category', 'Post'); at the top so I
> should be able to access the category table?)
>
> I've tried:     $my_title = $this->Category->field('name');   &&
> $my_title = $data['Category']['name']; and a few other variations with
> no joy.
>
> I'm a bit stumped, it is maybe something stupid that I am doing as I
> am fairly new to cake.
>
> Thanks in advance.
>
> On May 22, 5:57 pm, "dr. Hannibal Lecter" <[email protected]> wrote:
>
>
>
> > This works for me (in controller):
>
> > $this->set
> >       (
> >         'channel',
> >         array
> >         (
> >           'title' => $dynamicTitleHere,
> >           'description' => 'Yer description'
> >         )
> >       );
>
> > On May 22, 5:57 pm, number9 <[email protected]> wrote:
>
> > > Is there anyway to set make an RSS feed title dynamic? I'm not talking
> > > about the item titles, but the single title that is referenced from
> > > pageTitle.
>
> > > I know that you can alter it statically, but I have setup an RSS feed
> > > for all of my categories (from one view/action), so cannot declare an
> > > individual title for each feed (besides that would go against the DRY
> > > philosophy).
>
> > > I have tried in both the view and controller to use a variable for the
> > > title but it just doesn't work.
>
> > > E.g:
>
> > >         // grab category name and store in a variable:
> > >         $pageTitle = $this->pageTitle = $data['Category']['name'];
> > >         // Set channel variables for feed:
> > >         $channel = array (
> > >         'title' => $pageTitle,
>
> > > Has anybody managed this?
>
> > > Thanks in advance!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to