Thanks David,
I cant seem to get page.mc to pull in related_media.
Ive included the code from column.mc and page.mc that
Im using below. This is from the documentation and the
elements that come with bricolage. Below the code is
an explanation of whats happening.
############ From column.mc ############
<!-- Start "Column" -->
%# Only show this if we are on the first page
% unless ($burner->get_page) {
<h1><% $story->get_title %></h1>
<% $element->get_data('deck') %>
<hr />
% }
%# Display all the pages of this story
% $burner->display_pages('page');
<br>
Page <% $burner->get_page + 1 %>
<!-- End "Column" -->
############ End column.mc ############
############ From page.mc ############
<!-- Start "Page" -->
<%perl>
foreach my $e ($element->get_elements) {
if ($e->has_name('paragraph')) {
$m->out('<p>'.$e->get_data.'</p>');
} elsif ($e->has_name('pull_quote')) {
$burner->display_element($e);
} elsif ($e->has_name('inset')) {
$burner->display_element($e);
} elsif ($e->has_name('subtitle')) {
$burner->display_element($e);
}
}
</%perl>
<hr />
%# $burner numbers pages from '0' not '1'.
% my $pnum = $burner->get_page + 1;
%# Show 'previous' link
% my $prev = $element->get_data('previous');
% if ($prev) {
<a href="index<% $pnum-2 != 0 ? $pnum-2 : '' %>.html">
<<< Page <% $pnum - 1 %> : </a>
<% $prev %>
% }
%# Show 'next' link
% my $next = $element->get_data('next');
% if ($next) {
<% $next %>
<a href="index<% $pnum %>.html">
: Page <% $pnum + 1 %> >>>
</a>
% }
<!-- End "Page" -->
############ End page.mc ############
If I create a Column using the template code above
(as in a weekly column using column.mc which has a
page sub element) this works fine, clicking on the
preview link will bring up the story including all the
elements and sub elements e.g. deck, title, page,
etc... But when I add the code below to page.mc to
pull in the image, then click on the preview link,
only the column element is displayed. i.e the column
element no longer displays the page element. Im
putting this code at the bottom of the page.mc
template to test it. Can anyone tell me what Im doing
wrong?
##### Related media code added to page.mc #####
<img src="<& /path/to/related_media.mc, $muri &>"
align="left" alt="<% escape_html($media->get_name) %>"
border="1" height="<% $height %>"
width="<% $width %>" />
<%init>;
my $media = $element->get_related_media or return;
my $melem = $media->get_tile;
my $width = $melem->get_data('width');
my $height = $melem->get_data('height');
my $muri =
$media->get_uri($media->get_output_channels($burner->get_oc->get_id));
</%init>
##### End Related media code added to page.mc ######
Thanks.
--- David Wheeler <david@wheeler.net> wrote:
> On Friday, January 10, 2003, at 10:20 AM, Sandy R
> wrote:
>
> > If I associate a related media element as a sub
> > element of a page element, how do I pull the
> related
> > media element into the page? Does anyone have a
> code
> > example that does this?
>
> <img src="<& /lib/xhtml/format_uri.mc, $muri &>"
> align="left"
> alt="<% escape_html($media->get_name) %>"
> border="1"
> height="<% $height %>" width="<% $width %>"
> />
>
> <%init>;
> my $media = $element->get_related_media or return;
> my $melem = $media->get_tile;
> my $width = $melem->get_data('width');
> my $height = $melem->get_data('height');
> my $muri =
> $media->get_uri($media->get_output_channels
>
> ($burner->get_oc->get_id));
> </%init>
>
> HTH,
>
> David
>
> --
> David Wheeler
> AIM: dwTheory
> david@wheeler.net
> ICQ: 15726394
> http://david.wheeler.net/
> Yahoo!: dew7e
>
> Jabber: Theory@jabber.org
>
__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com -------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com _______________________________________________
Bricolage-General mailing list
Bricolage-General@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bricolage-general