Post by Joe1234 » Fri Dec 06, 2024 3:00 am

I created a dashboard mod. In the extensions section I don't see a title for the mod. All I see is "heading_title" for the mod where the title should be. How do I make a title appear for the mod? My actual twig form and page have their title, and I don't see how to set it in the controller.
Last edited by Joe1234 on Tue Dec 10, 2024 1:17 pm, edited 1 time in total.

v3.0.4.0 php 8.1
I'm here for a reason, if your response is contact a/the developer, just don't reply.


Active Member

Posts

Joined
Sat Jan 01, 2022 5:47 am

Post by ADD Creative » Fri Dec 06, 2024 3:47 am

Do you have heading_title defined in your language file?

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by OSWorX » Fri Dec 06, 2024 2:05 pm

Joe1234 wrote:
Fri Dec 06, 2024 3:00 am
I created a dashboard mod. In the extensions section I don't see a title for the mod. All I see is "heading_title" for the mod where the title should be. How do I make a title appear for the mod? My actual twig form and page have their title, and I don't see how to set it in the controller.
As ADD Creative already mentioned: do you have a language file admin/language/en-gb/extension/dashboard/YOUR_EXTENSION_NAME.php ?
If not, create one and add the variable heading_title (must be that name) with a value to it.

But that is the normal process.
Every extension which is listed under extensions, must have at least one (1) language file and one (1) controller.

p.s.: what I do not understand, you said you have "developed" an extension, why not check how others do that?

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Administrator

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by Joe1234 » Tue Dec 10, 2024 1:17 pm

I did have a language file that the controller was pointing to. The problem was I didn't change the file name itself to the name of my mod because I cannibalized an existing module to make this to figure out how things go. What's weird to me is, every other entry in the language file was picked up except for the heading entry. I now created the language file of the same name of my mod....and DID NOT point the controller to this new language file...and my mod picked up the heading of that language file. That is very odd behavior to me. Either way, I see how that oddness works now. Thanks.

v3.0.4.0 php 8.1
I'm here for a reason, if your response is contact a/the developer, just don't reply.


Active Member

Posts

Joined
Sat Jan 01, 2022 5:47 am

Post by ADD Creative » Wed Dec 11, 2024 3:58 am

It was probably the way the extension list works. It searches for controller files and then loads language files of the same name.

https://github.com/opencart/opencart/bl ... hp#L83-L93

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by OSWorX » Wed Dec 11, 2024 12:10 pm

Joe1234 wrote:
Tue Dec 10, 2024 1:17 pm
What's weird to me is, every other entry in the language file was picked up except for the heading entry.
Reason could be, that "your" new extension is using the same variables as the others.
Only the heading_title is different.

The logic at the those lists is, to fetch first all controllers the system may find in that folder (module, payment, shipping, etc.).
Then loops through all, load the corresponding language files and try to get the heading_title
If that is not present, it shows you just heading_title instead.

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Administrator

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria
Who is online

Users browsing this forum: lockiedownunder and 14 guests