ECR and attachment

1 year 1 month ago #10597 by katons
Hello,
your plugin is perfect for me, but in my article there is attachment added with plugins "attachment" unfortunately attachments are also displayed in the article even before you enter the password.
I really need to limit the view even of those.
Thanks for your help
Eric
Attachments:

1 year 1 month ago #10601 by Vitja
Hello Katons,

first of all, thank you for activating a support subscription!

You have to put all the text that should be hidden within the ECR syntax.

In your case:
[ecr|password=XXX]
{attachments}
[/ecr]

Change XXX to your own password.

Have success!

Kubik-Rubik Joomla! Extensions

Please support my work with a review in the Joomla! Extensions Directory: extensions.joomla.org/profile/profile/details/61997
1 year 1 month ago #10603 by katons
Sorry, but don't run...
I use your code but in front-end I see the attachment until to insert the password
1 year 1 month ago #10604 by Vitja
Hi Katons,

of course, it also depends on how the attachment plugin replaces its own syntax.

Try to a change the ordering of ECR (move to first / to last position) and check whether it changes the output!

Open the plugin settings and change the ordering on the right side (third option).

Please give feedback, thanks!

Kubik-Rubik Joomla! Extensions

Please support my work with a review in the Joomla! Extensions Directory: extensions.joomla.org/profile/profile/details/61997
1 year 1 month ago #10605 by katons
Hello,
sorry but don't understand what should I do...
Try to a change the ordering of ECR ?
Open the plugin settings and change the ordering on the right side (third option)?
I'm so sorry
1 year 1 month ago #10606 by Vitja
No problem! The ordering of the plugins defines the execution ordering. So, if you change the execution, then the attachments might not be added any more (as I said, this depends on the replacement function of the plugin).

Open the settings page of ECR and change the ordering (try both variants - first and last):



Once changed, save the settings and check the output in the frontend!

Kubik-Rubik Joomla! Extensions

Please support my work with a review in the Joomla! Extensions Directory: extensions.joomla.org/profile/profile/details/61997
Attachments:
1 year 1 month ago #10607 by katons
Hello,
i try also in the first and in the last...but nothing
I am desperate :(
1 year 1 month ago #10608 by Vitja
Don't worry, we will fix it together. Can you name me the attachment plugin that you are using? I have to look into the code.

Kubik-Rubik Joomla! Extensions

Please support my work with a review in the Joomla! Extensions Directory: extensions.joomla.org/profile/profile/details/61997
1 year 1 month ago #10609 by katons
thank you! if we solve will make a donation to thank you!
the attachment plugin is jmcameron.net/attachments/
and I use joomla 3.6.5
Thanks so much
1 year 1 month ago - 1 year 1 month ago #10610 by Vitja
Okay, I've just analyzed the attachment plugin. It's quite easy to modify it to get your wished result! :-)

You need to activate the custom placement with {attachments} (I think you already did it from looking on your screenshot).

Use ECR like this in your article:

[ecr|password=XXX]

{attachments}

[/ecr]

Please change the password.

Now, the modification part. We need to change only one single line in the attachment plugin! :-)

Open: plugins/attachments/attachments_plugin_framework/attachments_plugin.php

Search (lines 981 - 982):

// If there is no tag, insert the attachments at the end
$content->$text_field_name .= $html;

Change to:

// If there is no tag, insert the attachments at the end
// $content->$text_field_name .= $html;

Save it and replace the file on the server. Now you will get the following result. First load with the password form:



After submitting the correct password:



Have success!

Kubik-Rubik Joomla! Extensions

Please support my work with a review in the Joomla! Extensions Directory: extensions.joomla.org/profile/profile/details/61997
Attachments:
Time to create page: 0.294 seconds