Refactor processStyle so there's no duplicated code. Make Wobject call
SUPER. Add an option to skip adding getExtraHeadTags, so that Shortcut doesn't add them an extra time. Remove the subclassed getExtraHeadTags, since prepareView will add them, which prevents adding them a 3rd time.
This commit is contained in:
parent
66843db604
commit
b0a1e20053
4 changed files with 50 additions and 43 deletions
|
|
@ -377,28 +377,16 @@ sub processPropertiesFromFormPost {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 processStyle ( output )
|
||||
=head2 processStyle ( )
|
||||
|
||||
Returns output parsed under the current style. Sets the Asset's extra head tags
|
||||
into the raw head tags, too.
|
||||
|
||||
=head3 output
|
||||
|
||||
An HTML blob to be parsed into the current style.
|
||||
Returns output parsed under the current style. See also Asset::processStyle.
|
||||
|
||||
=cut
|
||||
|
||||
sub processStyle {
|
||||
my ($self, $output) = @_;
|
||||
my $session = $self->session;
|
||||
my $style = $session->style;
|
||||
$style->setRawHeadTags($self->getExtraHeadTags);
|
||||
if ($self->get('synopsis')) {
|
||||
$style->setMeta({
|
||||
name => 'Description',
|
||||
content => $self->get('synopsis'),
|
||||
});
|
||||
}
|
||||
my ($self, $output, $options) = @_;
|
||||
$output = $self->SUPER::processStyle($output, $options);
|
||||
my $style = $self->session->style;
|
||||
if ($style->useMobileStyle) {
|
||||
return $style->process($output,$self->get("mobileStyleTemplateId"));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue