×

Notice

The forum is in read only mode.
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Pre-fill description field

Pre-fill description field 12 years 3 months ago #17219

  • Blake McClelland
  • Blake McClelland's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 16
  • Thank you received: 0
Hi,

I was just wondering if there was any way to have Hotspots pre-fill the description field when adding a new location.

For example, when creating a hotspot, it will already have a table inserted into the description field.

Thanks,
Blake

Pre-fill description field 12 years 3 months ago #17220

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Hey Blake,
You can try editing
components/com_hotspots/models/form/marker.xml for frontend
administrator/components/com_hotspots/models/form/marker.xml

and where it says
<field name="hotspotText" type="editor" class="inputbox required"
               label="COM_HOTSPOTS_FIELD_DESCRIPTION" description="COM_HOTSPOTS_FIELD_DESCRIPTION_DESC"
               filter="JComponentHelper::filterText" buttons="article,image,pagebreak" required="true"/>

add a default value like this
<field name="hotspotText" type="editor" class="inputbox required" default="something"
               label="COM_HOTSPOTS_FIELD_DESCRIPTION" description="COM_HOTSPOTS_FIELD_DESCRIPTION_DESC"
               filter="JComponentHelper::filterText" buttons="article,image,pagebreak" required="true"/>

But you won't be able to use html in there.
Kind regards,
Daniel

Pre-fill description field 12 years 3 months ago #17313

  • Torsten Roecker
  • Torsten Roecker's Avatar
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 56
  • Thank you received: 1
Hi @all,

I've fixed this by using Joomla Plugin Content Templater (Autoload,...).
Second way is to create your own TinyMCE Templates.


Kind regards Torsten
The following user(s) said Thank You: Blake McClelland

Pre-fill description field 12 years 3 months ago #17314

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
@Torsten - it would be cool if you could share a step by step instructions ^^

Pre-fill description field 12 years 3 months ago #17319

  • Blake McClelland
  • Blake McClelland's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 16
  • Thank you received: 0
Content Templater was EXACTLY what I was looking for, thank you so much!

Pre-fill description field 12 years 3 months ago #17320

  • Torsten Roecker
  • Torsten Roecker's Avatar
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 56
  • Thank you received: 1
Dear Daniel,

there it is :)

Creating your own TinyMCE Templates:

1. create your own .html Template and save at /media/editors/tinymce/templates/
Example: hotspot.html
<p><span style="text-decoration: underline; font-size: large;"><strong>Test Template</strong></span></p>
<p></p>
<p>Table:</p>
<table border="0">
<tbody>
<tr>
<td>Head1</td>
<td>Text1</td>
</tr>
<tr>
<td>Head2</td>
<td>Text2</td>
</tr>
</tbody>
</table>

2. edit /media/editors/tinymce/templates/ template_list.js to load your Template
Example:
["HotSpot", "media/editors/tinymce/templates/hotspot.html", "HotSpot Example"],

3. clean your Browser cache

4. open your Add HotSpot site and you'll find the new created template there:








I have not found a way to auto insert the Template while page/TinyMCE load, but there is another Joomla Plugin called Content Templater doing this :)


Kind regards Torsten
Attachments:
  • Page:
  • 1
Time to create page: 0.119 seconds