Skip to content

Commit

Permalink
Issue View Attachment in article view jmcameron#40
Browse files Browse the repository at this point in the history
try other change
  • Loading branch information
JLTRY committed Apr 18, 2024
1 parent b786f6f commit 24854c3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
7 changes: 1 addition & 6 deletions attachments_for_content/attachments_for_content.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,7 @@ protected function getTextFieldName(&$row, $parent_entity)
$text_field_name = 'introtext';
}

if (($view == 'category') AND ($layout == 'blog') AND ($parent_entity == 'article'))
{
$text_field_name = 'text';
}

if (($view == 'article') AND ($layout == 'blog') AND ($parent_entity == 'article'))
if ((($view == 'category') OR ($view == 'article')) AND ($layout == 'blog') AND ($parent_entity == 'article'))
{
$text_field_name = 'text';
}
Expand Down
20 changes: 12 additions & 8 deletions attachments_plugin/attachments.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,19 @@ public function onContentPrepare(Event $event)
// This callback handles everything but articles
if ( $parent_type == 'com_content' )
{
if (in_array($parent_entity, Array('featured', 'article'))) {
$parent_entity = 'article';
}
if ($parent_entity == 'category.title') {
// Do not add attachments to category titles (Joomla 3 only)
return false;
if ( $parent_type == 'com_content' )
{
if (in_array($parent_entity, Array('featured', 'article'))) {
$parent_entity = 'article';
}
elseif ($parent_entity == 'category.title') {
// Do not add attachments to category titles (Joomla 3 only)
return false;
}
else {
$parent_entity = 'category';
}
}


}

$input = $this->app->getInput();
Expand Down

0 comments on commit 24854c3

Please sign in to comment.