joomla module params show image in backend - joomla

how to show image in module field params and in backend? like the following code
<field
name="imagesspec"
type="ooooooooooo"
image="spec.png"
/>
the img not work in module params
<fieldset name="basic">
<img src="xxxxx.jpg">
I google it many days but there no any example or answer
<fields name="params">
<fieldset name="basic">
<!-- Is it possible? -->
<field name="imagesspec" type="ooooooooooo" image="spec.png"/>
<img src="xxxxxxxx"> <--it's not work
..
..
bla bla bla
</fieldset>
</fields>

I find the solution,add a customfield type,nothing more

Related

Joomla4 : how to set parameters in an extension?

I have developed a Joomla3 extension and I try to run in in Joomla4.1
In my XML file:
<extension version="3.1" type="plugin" group="content" method="upgrade">
<config>
<fields name="params">
<fieldset name="basic">
<field name="webmasterid" type="text" default="" label="Enter webmasterid"/>
<field name="password" type="password" default="" label="Enter Password"/>
</fieldset>
</fields>
</config>
But I don't see any way from my /administrator/ panel where I can set these 2 params:
webmasterid, password
What is the correct way to have them displayed in /administrator/ panel ?
(the plugin still works correctly, but I have to set these values directly in my plugin code)

odoo inheritance of view element without name or id

In odoo I try to change the recruitement form, but some of the stuctural elements dont have a name or id. When I change those elements it works fine initially, but when I upgrade the database then the rendering of the xml is stricter for some reason and gives an ParseError.
The recruitement form:
<sheet>
<div class="oe_button_box" name="button_box"/>
<div class="oe_title">
<label for="name" class="oe_edit_only"/>
<h1><field name="name" placeholder="e.g. Sales Manager"/></h1>
</div>
<notebook>
<page string="Job Description">
<div attrs="{'invisible': [('state', '!=', 'recruit')]}">
<label for="description"/>
<field name="description" type="html"/>
</div>
</page>
<page name="description_page" string="Description">
<field name="description" type="html"/>
<div class="d-none oe_clear"/>
</page>
<page string="Recruitment">
<group>
<group name="recruitment">
<field name="company_id" options="{'no_create': True}" groups="base.group_multi_company"/>
<field name="department_id"/>
</group>
<group>
<field name="no_of_recruitment"/>
</group>
</group>
</page>
</notebook>
</sheet>
As you can see; the sheet, notebook, pages and groups mostly dont have a name. The string attribute is also not sufficient to modify with a expression in xpath. So it feels like I'm just stuck with this framework.
What I try:
<xpath expr="//sheet/notebook" position="replace">
<notebook>
<page name="description_page" string="Description">
<field name="description" type="html"/>
<div class="d-none oe_clear"/>
</page>
<page string="Recruitment">
<group>
<group name="recruitment">
<field name="branch_concept" />
<field name="branch" />
<field name="department_id" />
</group>
<group>
<field name="no_of_recruitment"/>
</group>
</group>
</page>
</notebook>
</xpath>
And this works until I do a db upgrade, then I get a parseError.
Does anybody know I can use my own structure?
In the xpath expression you use //<some_node> to 'Selects nodes in the document from the current node that match the selection no matter where they are'. You can also use /<some_node>/<some_other_node> to locate a specific element.
for example /form/sheet/notebook/page[1]

TypeError: dict.record.id is undefined when I access to my custom kanban view in Odoo 11

I have a custom module that had a kanban view. His model inherits from res.users (and res.users inherits from res.partner).
I have a problem when I try to access to kanban view of my module. I know where is the error, but i donĀ“t have idea for how to solve.
The error is:
Error: QWeb2 - template['kanban-box']: Runtime Error: TypeError: dict.record.id is undefined
This is my kanban view (maestro):
<record model="ir.ui.view" id="maestro_kanban_view">
<field name="name">maestro.kanban.view</field>
<field name="model">aula10.maestro</field>
<field name="groups_id" eval="[(4, ref('grupo_maestros'))]"/>
<field name="arch" type="xml">
<kanban>
<field name='name'/>
<field name='image'/>
<templates>
<t t-name="kanban-box">
<div class="oe_kanban_global_click">
<div class="o kanban_image">
<img t-att-src="kanban_image('maestro','image_medium', record.id.value)"/>
<div class="oe_kanban_details">
<!-- Title and Data content -->
<h4>
<a type="open">
<field name="name"/>
</a>
</h4>
</div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
I know the problem is in the image, in record.id.value, because when I erase the img tag, the error disappear.
How can I fix this?
In kanban view you must mention every fields you use in the field list like in your code you have mentioned two fields nameand image just add id to them and Odoo should recognize it.
<field name='id'/>
<field name='name'/>
<field name='image'/>

Joomla/K2 Listing K2 categories in a module parameter

Is it possible to list K2 categories in a module parameter using something like the default Joomla category field type?
<field name="mycategories" type="category" extension="com_content" multiple="true" label="Category" description="" />
Thanks in advance.
Taken from K2 content Module:
<fieldset name="basic" addfieldpath="/administrator/components/com_k2/elements/">
...
<field name="category_id" type="categoriesmultiple" default="" label="K2_SELECT_ONE_OR_MORE_CATEGORIES" description="K2_SELECT_ONE_ORE_MORE_CATEGORIES_FOR_WHICH_YOU_WANT_TO_FILTER_AN_ITEMS_LIST_SELECT_NONE_TO_FETCH_ITEMS_FROM_ALL_CATEGORIES"/>
....
</fieldset>

Joomla: what is wrong with my plugins XML - config-section is not shown?

I am trying to upgrade an old mambot. It's possible that there are still bugs in the code, but even the config-screen does not show up, only the basic pi-parameters are there, none of mine. What am I missing?
<?xml version="1.0" encoding="iso-8859-1" ?>
<extension type="plugin" group="content" version="1.6" method="upgrade">
<name>mb_append</name>
<creationDate>June 08, 2013</creationDate>
<version>1.1</version>
<author>Michael Baas</author>
<authorName>Michael Baas</authorName>
<authorEmail>michael#mbaas.de</authorEmail>
<authorUrl>mbaas.de</authorUrl>
<description>
<![CDATA[
<p>Very simple bot to append constant <i>(configureable)</i> text (i.e. <br>-tags!) to the
article and the output. 'Output' includes the "ReadMore..."-Link (but not the
navigation). (However, if you absolutely
need this, let me know and I may implement it, but it's a bit tricky, so I would only
do this if somebody can convince me he needs it ;)</p>
<p>In case you want to insert multiple texts between the output of other plugins etc., you can
create further instances of this plugin by simply renaming the PHP and XML in the
installation-ZIP AND by adjusting the names in the XML and then just install your
'new' mambot! :)</p>
<p><b>Links</b> <i>(automatically open in new window)</i>:
<ul>
<li>Michael's Homepage
</ul>
]]>
</description>
<copyright>(c) 2013 Michael Baas</copyright>
<license>GPL</license>
<files>
<filename plugin="mb_append">mb_append.php</filename>
</files>
<config>
<fields name="config">
<fieldset name="basic">
<field name="txt_app" type="text" default="" label="Append 2 article" description="The text you want to append to the article" size="40" />
<field name="txt" type="text" default="" label="Append 2 output" description="The text you want to append to the output" size="40"/>
<field name="look4txt" type="radio" value="1" label="Check if txt already there?" description="Check if the specified text has already been added to the text and do not add again if this option is activated.">
<option value="0">No</option>
<option value="1">Yes</option>
</field>
<field name="excat" type="text" default="" label="Categories to EXCLUDE" description="Comma-separated list of IDs" size="40"/>
<field name="exid" type="text" default="" label="Article-IDs to EXCLUDE" description="Comma-separated list of IDs OR a 'less-than'-sign (arrow-left) followed by ONE number to exclude all IDs smaller than thew number you specified!" size="40" />
</fieldset>
</fields>
</config>
</extension>
Change the <fields name="config"> to <fields name="params">. This might work then.

Resources