Shared controller not working

I see, well this tag is meant for use anywhere on the site, in any template, so i’m guessing it will have to be as Ive got it or as a file method?

I’d probably use a file method.

1 Like

Actually, shouldn’t it be a field method because this image always comes from a image field?

There are many options… but since you can only use it with an image field, a file method would be more appropriate, I think.

I think will just stick with what i’ve got. Ive realised $page will change if that tag is used inside a for each loop, as in an article list so i guess its fine.

My goal is reduce all my common stuff down to the least amount of typing… one down… many more to go…

Well, yes, but I think your function is still too specialized; it would need an additional argument, i.e. the field name, to make it usable anywhere.

I think thats ok, every page, using every template has an articleimage() field. i have a standard set of global blueprints for the whole site that get template specific additions where neccessary.

Basically Im building a boilerplate that i use to build sites with, this isn’t a specific site. It’s my own Starter kit if you will.

Im just trying to refactor it and streamline as much as possible.

Of course, you are a free man :slightly_smiling_face: