This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

PopcornPHP
PopcornPHP

Hi! In my component of plugin I wrote:

{% partial __SELF__ ~ '::' ~ view %}

The variable 'view' - it variable gets from URL, and then I require a 'partial'. If this partial is not exist - I get error

An exception has been thrown during the rendering of a template ("The partial 'Blog::news1' is not found.").

How I can check, if this partial is exist?

Thank you!

Last updated

daftspunky
daftspunky

I think the greater question is, how did you arrive here? Are you calling __SELF__ from a shared component partial or something?

PopcornPHP
PopcornPHP

Component have default.htm partial, __SELF__ calling from this file.

Why I do that? For example me need just two tabs 'News' and 'Reviews' (in real project, this tabs may be 5-10). I did this for two reasons:

  1. My need a pagination for 'News' and 'Reviews'
  2. Reduce the load on the server and get appointment only 'News' OR 'Reviews'.

I need something that one component handles multiple species.

I hope that I have described my problem as simply and clearly. In any case, the question is how the method onRun () to make check the presence of the partial (partial into component directory), and if it is not - lead 404.

Thank you!

1-3 of 3

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.