[LON-CAPA-users] Finding page title

Guy Albertelli II lon-capa-users@mail.lon-capa.org
Wed, 24 Jan 2007 21:17:55 -0500 (EST)


Hi Brew,

> An author's directory listing shows
> Name                 Title
> EmptyJudge.page      Empty Judge 12
>   consists of
> EmptyProb.problem    [untitled]
> JudgeCheck.problem   Play Judge Check
> 
> In the Course Documents/Administrative folder, EmptyJudge.page is imported
> and renamed to
> Empty Judge 15
> (the 12 and 15 are just random numbers so I can distinguish what title I am
> getting).
> 
> Goal: I want to get "Empty Judge 15", the title the student sees at the top
> of the page.
> 
> resource.title gives Play Judge Check, the title of the current problem
> 
> resource.map (and resource.map.title, resource.map.name,
> resource.map.displaytitle, resource.map.map.title, resource.map.map.name,
> resource.map.map.displaytitle, resource.map.garbage) gives
> a/bunch/of/directory/stuff/EmptyJudge.page
> Apparently once I say resource.map, it doesn't matter what I append to
> that.


Did you try
$map_title =  &EXT('resource.title',&EXT('resource.map'));

as I suggested?

(What is going on here is 
- by default &EXT() returns information about the resource it is
  called by
- you want to get information about a different resource (not the
  .problem but the .page container)
- To do this you can give &EXT() a second argument that specifies what
  resource you want the information about
- To specify a separate resource you need the internal name for the
  resource (we call that the symb) you can either get that from DOCS
  (there is button that will give you all of the symbs in the course)
  or you can ask.
- &EXT('resource.map') returns the internal name of the
  map that contains the resource that called &EXT()

Thus
$symb_of_the_page = &EXT('resource.map');
$title_of_the_current_resource = &EXT('resource.title');
$title_of_the_page_this_resource_is_in = &EXT('resource.title', $symb_of_the_page);

And if we want to go up another level:

$symb_of_the_map_the_page_is_in = &EXT('resource.map',$symb_of_the_page);
$title_of_the_map_that_contains_the_page_this_resource_is_in = &EXT('resource.title', $symb_of_the_map_the_page_is_in);


> 
> map.anything returns blank.
> 
> So, close but no cigar. I still can't quite get the "Empty Judge 15" string
> into my script.
> 
> brew
> -----lon-capa-users-admin@mail.lon-capa.org wrote: -----
> 
> To: lon-capa-users@mail.lon-capa.org
> From: Guy Albertelli II <guy@albertelli.com>
> Sent by: lon-capa-users-admin@mail.lon-capa.org
> Date: 01/24/2007 04:52PM
> Subject: Re: [LON-CAPA-users] Finding page title
> 
> Hi Brew,
> 
> > Within a problem on a page, I am trying to retrieve the name of the page.
> I
> > have spent several hours now trying various combinations of &EXT()
> strings,
> > with no luck.
> >
> > Structure is:
> >
> > myPage.page  has a title of "My Page"
> > contains     problem1.problem
> >              problem2.problem
> >
> > problem2 needs to obtain the string "My Page".
> 

> 
> Let me know if any of that needs explaining...
> 
> I'll likely try to work on the ext_examples.problem more to get more
> complete documentation in there...
> 
> > I thought I should be able to use displaytitle somehow,
> 
> Hmm, I could add something like <displaytitle level="1" /> or
> maybe <displaytitle resource="...symb or url..." />
> 
> --
> guy@albertelli.com   0-7-0-9-27,137
> _______________________________________________
> LON-CAPA-users mailing list
> LON-CAPA-users@mail.lon-capa.org
> http://mail.lon-capa.org/mailman/listinfo/lon-capa-users
> 
> _______________________________________________
> LON-CAPA-users mailing list
> LON-CAPA-users@mail.lon-capa.org
> http://mail.lon-capa.org/mailman/listinfo/lon-capa-users
> 

-- 
guy@albertelli.com   0-7-0-9-27,137