Skip to main content

Questions tagged [extends]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer

Event on new user created

please can someone help me with this snippet of code I have written. I basically would like to check if a user is new. However, the below only triggers when an existing user is saved, not when a new ...
Mark's user avatar
  • 741
1 vote
1 answer

How to Extend Craft CMS frontend controller?

How to extend craft's front end controllers? I don't want to use twig. I like twig but I don't want to use it in craft. Respect my decision and help me. Is there a good way to do that?. So I can ...
user's user avatar
  • 63
1 vote
1 answer

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 ...
Joorren's user avatar
  • 305
2 votes
3 answers

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 ...
Urs's user avatar
  • 639
1 vote
1 answer

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 ...
casey's user avatar
  • 437
0 votes
2 answers

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 ...
Christopher Healey's user avatar
4 votes
1 answer

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 ...
Chris's user avatar
  • 55
1 vote
1 answer

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 ...
Cole Henley's user avatar
  • 1,741
2 votes
1 answer

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. {% ...
Miksu Aaja's user avatar
1 vote
1 answer

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 ...
Oliver Stark's user avatar
2 votes
2 answers

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: &...
Ole's user avatar
  • 245
2 votes
1 answer

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 ...
CodeMonkey's user avatar
1 vote
1 answer

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 ...
Neal Magee's user avatar
1 vote
1 answer

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?
kr37's user avatar
  • 1,355
2 votes
1 answer

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 ...
Alex's user avatar
  • 427
4 votes
2 answers

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 ...
KeironLowe's user avatar
10 votes
2 answers

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'...
Steve Adams's user avatar
  • 1,671