Skip to content

Commit 24854c3

Browse files
author
JLTRY
committed
Issue View Attachment in article view jmcameron#40
try other change
1 parent b786f6f commit 24854c3

File tree

2 files changed

+13
-14
lines changed

2 files changed

+13
-14
lines changed

attachments_for_content/attachments_for_content.php

+1-6
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,7 @@ protected function getTextFieldName(&$row, $parent_entity)
158158
$text_field_name = 'introtext';
159159
}
160160

161-
if (($view == 'category') AND ($layout == 'blog') AND ($parent_entity == 'article'))
162-
{
163-
$text_field_name = 'text';
164-
}
165-
166-
if (($view == 'article') AND ($layout == 'blog') AND ($parent_entity == 'article'))
161+
if ((($view == 'category') OR ($view == 'article')) AND ($layout == 'blog') AND ($parent_entity == 'article'))
167162
{
168163
$text_field_name = 'text';
169164
}

attachments_plugin/attachments.php

+12-8
Original file line numberDiff line numberDiff line change
@@ -129,15 +129,19 @@ public function onContentPrepare(Event $event)
129129
// This callback handles everything but articles
130130
if ( $parent_type == 'com_content' )
131131
{
132-
if (in_array($parent_entity, Array('featured', 'article'))) {
133-
$parent_entity = 'article';
134-
}
135-
if ($parent_entity == 'category.title') {
136-
// Do not add attachments to category titles (Joomla 3 only)
137-
return false;
132+
if ( $parent_type == 'com_content' )
133+
{
134+
if (in_array($parent_entity, Array('featured', 'article'))) {
135+
$parent_entity = 'article';
136+
}
137+
elseif ($parent_entity == 'category.title') {
138+
// Do not add attachments to category titles (Joomla 3 only)
139+
return false;
140+
}
141+
else {
142+
$parent_entity = 'category';
143+
}
138144
}
139-
140-
141145
}
142146

143147
$input = $this->app->getInput();

0 commit comments

Comments
 (0)