Skip to content

Commit

Permalink
Issue View Attachment in article view #40
Browse files Browse the repository at this point in the history
adapt to be able to see attachement in article view
  • Loading branch information
JLTRY committed Mar 30, 2024
1 parent 9708370 commit e3f3b4b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions attachments_for_content/attachments_for_content.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,11 @@ protected function getTextFieldName(&$row, $parent_entity)
{
$text_field_name = 'text';
}

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

return $text_field_name;
}
Expand Down
8 changes: 4 additions & 4 deletions attachments_plugin/attachments.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,14 @@ public function onContentPrepare(Event $event)
if ( $parent_type == 'com_content' )
{
if (in_array($parent_entity, Array('featured', 'article'))) {
return false;
}
$parent_entity = 'article';
}
if ($parent_entity == 'category.title') {
// Do not add attachments to category titles (Joomla 3 only)
return false;
}
}

$parent_entity = 'category';

}

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

1 comment on commit e3f3b4b

@parapente
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JLTRY the changes in e3f3b4b are causing the plugin to show the attachments two times in the articles. I don't think that this is the problem with #40 . Probably he has problems with the tables in the database.

Please sign in to comment.