Questions tagged [extends]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
3answers
401 views

Templating basics: extend, include or use?

I'm making first steps with Twig in Craft. Ok, it's a Twig question. But maybe you can give me the best practice for Craft? I'm used to create templates Top-Down, like having a master.html template ...
1
vote
1answer
89 views

Can a plugin manually raise another plugin's Event?

I have created an Adjuster which is attached to commerce_lineItems.onPopulateLineItem. The discount criteria is based on validation of a completely separate coupon API, so I created a permission-less ...
0
votes
2answers
119 views

Set Parent Template Defined Content to Output in Child Template

I have a layout template, we'll call that Template A that is extended by another template, we'll call that Template B that includes another template, we'll call that Template C that includes another ...
4
votes
1answer
348 views

The safest way to edit core Craft files?

I've been tasked with adding a column to the Entries screen to show some custom data that gets saved against each new post. To do this, I've edited craft/app/elementtypes/EntryElementType.php and ...
1
vote
1answer
188 views

Plugin Development: extending a vendor plugin

I'm using composer to import a third-party (vendor) plugin into my own Craft plugin. But can't figure out how I extend the functionality of the imported (vendor) plugin. For example assuming imported ...
2
votes
1answer
410 views

Why is news/_entry not extending _layout?

I'm quite sure the problem is my paths to .css files in the _layout.html file but just can't get my head around it. I've got this in my _layout.html. It works for home page and news page. {% ...
1
vote
1answer
194 views

Custom Asset Source Types - not possible

I would love to extend Craft with a custom AssetSourceType. However it looks like components of type 'assetSource' are not extensible (enableForPlugins = false). Is there a way to do this? Or can I ...
2
votes
2answers
1k views

Send a block… into a block?

I'm fiddling around with Twig and CraftCMS, trying to create a component-based structure... of sorts. All good so far, except this one thing I got stuck on. Here's an excerpt from my main layout: &...
2
votes
1answer
236 views

How to extend UserRecord?

I'm writing a customer portal plugin that will have 3 types of users. Organizations Organization members Private I would like to use Craft's built in UserRecord for front end login, backend ...
1
vote
1answer
223 views

Override a portion of an extends template

I'll give you my specific use-case here and then see if it might also be more generally applicable in other scenarios: We have a new Craft PRO site running happily, and in our /templates/ we have a ...
1
vote
1answer
259 views

What happens when extending an extended template?

If template2.html contains {% extends 'template1.html' %} and template3.html contains {% extends 'template2.html' %}, what happens to things like {% block %}{% endblock %} and variables?
2
votes
1answer
153 views

Change title url of elementtype in the list

I have a plugin. In this plugin I did elementtype which extends the user one, but with only one source "clients". I have and New Client button which points to my plugin Plugin_ClientController which ...
3
votes
2answers
657 views

How do I extend another plugin?

I'd like to know if it's possible to extend another plugin with my own. I'm currently using the Sprout Forms plugin to create a contact form on our website, and I would like to extend that so when a ...
8
votes
2answers
24k views

Is there a way to define a global var within a twig block?

Something that would work like this: {% block A %} {% set testVar = "foo" %} {% endblock %} ... {% block B %} {{ testVar }} {% endblock %} The scope of testVar seems limited to {% block A %} I'...