Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Try Vanilla Forums Cloud product
Vanilla 2.6 is here! It includes security fixes and requires PHP 7.0. We have therefore ALSO released Vanilla 2.5.2 with security patches if you are still on PHP 5.6 to give you additional time to upgrade.
Please upgrade to 2.3 here. The 2.2 and earlier branches are no longer being updated.

MyAttachments CSS issue? on Vanilla 2.3.1

This discussion is related to the My Attachments addon.

Hi, thank to @peregrine and @vrijvlinder but on Vanilla 2.3.1 then MyAttachments CSS file seems not inclued, is not?

Don't see something like this
<link rel="stylesheet" type="text/css" href="/plugins/MyAttachments/design/myattachments.css?v=2.2" media="all" />

Found this snippet in myattachmentstabview.php file

// Add the appropriate CSS file
$CSSType = C('Plugins.MyAttachments.CSSType');

if($CSSType) {
    $Sender->AddCssFile($this->GetResource('design' . DS . $CSSType, FALSE, FALSE));
}

Using default theme, not tried debbug mode ;-) but... may be an update is needed for now (since 2.3)

Comments

  • vrijvlindervrijvlinder Papillon-Sauvage MVP
    edited December 2017


    Have you selected the css file to be added in the settings ? You need to select a style sheet for one to be included. View Type is the setting for selecting style sheets.

  • Yep, thank you for your quick reply... "default" view type, not tried A for example, there are the following lines in my conf. file
    $Configuration['Plugins']['MyAttachments']['CSSType'] = 'myattachments.css';
    $Configuration['Plugins']['MyAttachments']['Count'] = '10';
    $Configuration['Plugins']['MyAttachments']['SortField'] = 'DateInserted';
    $Configuration['Plugins']['MyAttachments']['SortDirection'] = 'desc';
    $Configuration['Plugins']['MyAttachments']['ClickPref'] = '';
    $Configuration['Plugins']['MyAttachments']['RestrictToImages'] = false;
    $Configuration['Plugins']['MyAttachments']['ShowPager'] = '1';

    Removed code snippet related to CSSType and then tried to use this way so it's right...
    $Sender->AddCssFile('myattachments.css', 'plugins/MyAttachments');

    May be a cache issue ;) I 'll try on a fresh install

  • vrijvlindervrijvlinder Papillon-Sauvage MVP
    edited December 2017

    Removed code snippet related to CSSType and then tried to use this way so it's right...

    You removed the functionality to choose a different style sheet for the MyAttachments page view. So it's wrong. The default setting adds the default sheet if there is one, however it is not necessary . If you were to choose another style sheet as the examples suggest, you would see this instead.
    $Configuration['Plugins']['MyAttachments']['CSSType'] = 'myattachmentsA.css';

    You are welcome to experiment however you want.

  • Yep, of course ;) thanks to you for your support. No time to test it on a fresh install but added to my 2018 to do list ;) see you soon

Sign In or Register to comment.