Questions tagged [extends]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
69 views

Help with picking the right template tactic: include, embed, use, macro

I've run up against the limits of includes and macros for the context before me and can't quite get my head round other options such as use and embed, which I've never had need to use before. I know ...
1
vote
1answer
40 views

Not triggering SEOMatic on save element

I'm writing a module that loops over lines in a CSV file to save them as entries. For every entry I save with elements->saveElement($element);, SEOMatic will queue a job that regenerates the ...
2
votes
3answers
957 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
114 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
136 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
407 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
219 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
441 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
213 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
2k 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
258 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
275 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
439 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
155 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 ...
4
votes
2answers
807 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 ...
9
votes
2answers
30k 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'...