Remove quotes from Help vars.
Add crumb trail template variables to the Story. Fix links for keywords in the Story.
This commit is contained in:
parent
4867750fd9
commit
8e7fcd0e6c
4 changed files with 103 additions and 50 deletions
|
|
@ -684,7 +684,7 @@ sub viewTemplateVariables {
|
|||
foreach my $keyword (@{ $keywords }) {
|
||||
push @{ $var->{keyword_loop} }, {
|
||||
keyword => $keyword,
|
||||
url => $archive->getUrl("func=search;submit=1;keywords=".$session->url->escape($keyword)),
|
||||
url => $archive->getUrl("func=view;keywords=".$session->url->escape($keyword)),
|
||||
};
|
||||
}
|
||||
##TODO: publish time, calculated from revisionDate
|
||||
|
|
|
|||
|
|
@ -7,29 +7,29 @@ our $HELP = {
|
|||
title => 'edit template',
|
||||
body => '',
|
||||
isa => [
|
||||
{ namespace => "Asset_Template",
|
||||
tag => "template variables"
|
||||
{ namespace => 'Asset_Template',
|
||||
tag => 'template variables'
|
||||
},
|
||||
],
|
||||
fields => [],
|
||||
variables => [
|
||||
{ 'name' => 'formHeader',
|
||||
{ name => 'formHeader',
|
||||
'required' => 1 },
|
||||
{ 'name' => 'formTitle', },
|
||||
{ 'name' => 'formFooter',
|
||||
{ name => 'formTitle', },
|
||||
{ name => 'formFooter',
|
||||
'required' => 1 },
|
||||
{ 'name' => 'titleForm', },
|
||||
{ 'name' => 'subtitleForm', },
|
||||
{ 'name' => 'bylineForm', },
|
||||
{ 'name' => 'locationForm', },
|
||||
{ 'name' => 'keywordsForm', },
|
||||
{ 'name' => 'summaryForm', },
|
||||
{ 'name' => 'highlightsForm', },
|
||||
{ 'name' => 'storyForm', },
|
||||
{ 'name' => 'saveButton', },
|
||||
{ 'name' => 'previewButton', },
|
||||
{ 'name' => 'saveAndAddButton', },
|
||||
{ 'name' => 'cancelButton', },
|
||||
{ name => 'titleForm', },
|
||||
{ name => 'subtitleForm', },
|
||||
{ name => 'bylineForm', },
|
||||
{ name => 'locationForm', },
|
||||
{ name => 'keywordsForm', },
|
||||
{ name => 'summaryForm', },
|
||||
{ name => 'highlightsForm', },
|
||||
{ name => 'storyForm', },
|
||||
{ name => 'saveButton', },
|
||||
{ name => 'previewButton', },
|
||||
{ name => 'saveAndAddButton', },
|
||||
{ name => 'cancelButton', },
|
||||
],
|
||||
related => []
|
||||
},
|
||||
|
|
@ -38,25 +38,37 @@ our $HELP = {
|
|||
title => 'view template',
|
||||
body => '',
|
||||
isa => [
|
||||
{ namespace => "Asset_Template",
|
||||
tag => "template variables"
|
||||
{ namespace => 'Asset_Template',
|
||||
tag => 'template variables'
|
||||
},
|
||||
],
|
||||
fields => [],
|
||||
variables => [
|
||||
{ 'name' => 'highlights_loop',
|
||||
{ name => 'highlights_loop',
|
||||
'variables' => [
|
||||
{ 'name' => 'highlight', },
|
||||
{ name => 'highlight', },
|
||||
],
|
||||
},
|
||||
{ 'name' => 'keywords_loop',
|
||||
{ name => 'keywords_loop',
|
||||
'variables' => [
|
||||
{ 'name' => 'keyword', },
|
||||
{ 'name' => 'url', },
|
||||
{ name => 'keyword', },
|
||||
{ name => 'url',
|
||||
description => 'keyword_url'
|
||||
},
|
||||
],
|
||||
},
|
||||
{ name => 'updatedTime', },
|
||||
{ name => 'updatedTimeEpoch', },
|
||||
{ name => 'crumb_loop',
|
||||
'variables' => [
|
||||
{ name => 'title',
|
||||
description => 'crumb_title'
|
||||
},
|
||||
{ name => 'url',
|
||||
description => 'crumb_url'
|
||||
},
|
||||
],
|
||||
},
|
||||
{ 'name' => 'updatedTime', },
|
||||
{ 'name' => 'updatedTimeEpoch', },
|
||||
],
|
||||
related => []
|
||||
},
|
||||
|
|
@ -66,35 +78,61 @@ our $HELP = {
|
|||
title => 'story asset template variables title',
|
||||
body => '',
|
||||
isa => [
|
||||
{ namespace => "Asset",
|
||||
tag => "asset template variables"
|
||||
{ namespace => 'Asset',
|
||||
tag => 'asset template variables'
|
||||
},
|
||||
],
|
||||
fields => [],
|
||||
variables => [
|
||||
{ 'name' => 'headline',
|
||||
'description' => 'headline tmplvar',
|
||||
{ name => 'headline',
|
||||
description => 'headline tmplvar',
|
||||
},
|
||||
{ 'name' => 'subtitle',
|
||||
'description' => 'subtitle tmplvar',
|
||||
{ name => 'subtitle',
|
||||
description => 'subtitle tmplvar',
|
||||
},
|
||||
{ 'name' => 'byline',
|
||||
'description' => 'byline tmplvar',
|
||||
{ name => 'byline',
|
||||
description => 'byline tmplvar',
|
||||
},
|
||||
{ 'name' => 'location',
|
||||
'description' => 'location tmplvar',
|
||||
{ name => 'updatedTime', },
|
||||
{ name => 'updatedTimeEpoch', },
|
||||
],
|
||||
related => []
|
||||
},
|
||||
|
||||
'story asset template variables' => {
|
||||
private => 1,
|
||||
title => 'story asset template variables title',
|
||||
body => '',
|
||||
isa => [
|
||||
{ namespace => 'Asset',
|
||||
tag => 'asset template variables'
|
||||
},
|
||||
{ 'name' => 'highlights',
|
||||
'description' => 'highlights tmplvar',
|
||||
],
|
||||
fields => [],
|
||||
variables => [
|
||||
{ name => 'headline',
|
||||
description => 'headline tmplvar',
|
||||
},
|
||||
{ 'name' => 'story',
|
||||
'description' => 'story tmplvar',
|
||||
{ name => 'subtitle',
|
||||
description => 'subtitle tmplvar',
|
||||
},
|
||||
{ 'name' => 'photo',
|
||||
'description' => 'photo tmplvar',
|
||||
{ name => 'byline',
|
||||
description => 'byline tmplvar',
|
||||
},
|
||||
{ 'name' => 'storageId',
|
||||
'description' => 'storageId tmplvar',
|
||||
{ name => 'location',
|
||||
description => 'location tmplvar',
|
||||
},
|
||||
{ name => 'highlights',
|
||||
description => 'highlights tmplvar',
|
||||
},
|
||||
{ name => 'story',
|
||||
description => 'story tmplvar',
|
||||
},
|
||||
{ name => 'photo',
|
||||
description => 'photo tmplvar',
|
||||
},
|
||||
{ name => 'storageId',
|
||||
description => 'storageId tmplvar',
|
||||
},
|
||||
],
|
||||
related => []
|
||||
|
|
|
|||
|
|
@ -245,8 +245,23 @@ our $I18N = {
|
|||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'url' => {
|
||||
message => q|A URL to view all stories in this archive.|,
|
||||
'keyword_url' => {
|
||||
message => q|A URL to view all stories in this archive related to this keyword.|,
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'crumb_loop' => {
|
||||
message => q|A loop containing the crumbtrail. The first element will be a link to the archive that contains the story. The last element will be the story, with title and url. If there are 3 elements, the middle element will be the topic.|,
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'crumb_title' => {
|
||||
message => q|The title of a page in the crumb trail.|,
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'crumb_url' => {
|
||||
message => q|The title of a page in the crumb trail.|,
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -227,9 +227,9 @@ cmp_deeply(
|
|||
cmp_bag(
|
||||
$viewVariables->{keyword_loop},
|
||||
[
|
||||
{ keyword => "foxtrot", url => '/home/test-archive?func=search;submit=1;keywords=foxtrot', },
|
||||
{ keyword => "tango", url => '/home/test-archive?func=search;submit=1;keywords=tango', },
|
||||
{ keyword => "whiskey", url => '/home/test-archive?func=search;submit=1;keywords=whiskey', },
|
||||
{ keyword => "foxtrot", url => '/home/test-archive?func=view;keywords=foxtrot', },
|
||||
{ keyword => "tango", url => '/home/test-archive?func=view;keywords=tango', },
|
||||
{ keyword => "whiskey", url => '/home/test-archive?func=view;keywords=whiskey', },
|
||||
],
|
||||
'viewTemplateVariables: keywords_loop is okay'
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue