×

Notice

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

TOPIC: Description field

Description field 12 years 3 months ago #17025

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

I'm searching for a way to leave my users the choice of filling the description field or not. But as I understand the description is a mandatory field needed for creating the detail page.

Is it possible to create a workaround for this, maybe add an function like if description is empty set description = HotSpot name?
This would be great for me and my project :)


Many thanks in advance


Torsten

Description field 12 years 3 months ago #17026

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Hey Torsten,
Well, try that. Go to components/com_hotspots/models/forms/marker.xml and find this code:
<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"/>

Try to remove the required="true". Let me know if this works then. I think it should, but I haven't tested it.

cheers,
Daniel

P.S. This is for the frontend only - in the backend you have another .xml form to modify.

Description field 12 years 3 months ago #17028

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

many thank for the quick response!
I've change the mentioned code to required="false" and it's working, also the HotSpot detail site seems to run without problems :)
Do you also know the backend file I have to change and do you think I'll get problems with the empty description field?

Kind regards Torsten

Description field 12 years 3 months ago #17029

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
the backend file is located in administrator/components/com_hotspots/models/form/marker.xml :)

You should not get into problems with the missing description, but it is not nice to not have one :)

Cheers,
Daniel

Description field 12 years 3 months ago #17032

  • Torsten Roecker
  • Torsten Roecker's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 56
  • Thank you received: 1
Now I'm definitely sure, Compojoom has the best support I've seen since a long time :) MANY THANKS to you!

Your right it's not nice, but around 60% of the locations users add are there own location and they'll add nickname = hotspot name without details.
For the others it's important to have this details :)

Best regards Torsten

Description field 11 years 6 months ago #20749

  • Imtiaz Noor
  • Imtiaz Noor's Avatar
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 7
  • Thank you received: 0
Hi,

I've changed the description to non-mandatory using the instructions in this thread. It works fine, however there is just one slight issue.

When the side tab is opened, hotspots with no descriptions display the word "false" instead of just being empty. How do you get rid of the word "false"? I believe it's a javascript related issue.

Thanks for your time.

Description field 11 years 6 months ago #20777

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
\media\com_hotspots\js\modules\menu.js around line 675:
        var template = '<span class="hotspots-title">{{{title}}}</span>'
                + '<div>{{#thumb}}<img src="{{thumb}}" alt="{{title}}" class="hotspots-thumb"/>{{/thumb}}{{{description}}}</div>'
                + '<div class="clear-both"></div>';
change it to
        var template = '<span class="hotspots-title">{{{title}}}</span>'
                + '<div>{{#thumb}}<img src="{{thumb}}" alt="{{title}}" class="hotspots-thumb"/>{{/thumb}}</div>'
                + '<div class="clear-both"></div>';

Description field 11 years 6 months ago #20782

  • Imtiaz Noor
  • Imtiaz Noor's Avatar
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 7
  • Thank you received: 0
Thanks for your reply. This removes the description for every hotspot in the side tab, which is not what I want. I would like the descriptions for those hotspots which have descriptions to remain, and for those hotspots which do not have descriptions to be blank rather than displaying the word "false".

Description field 11 years 6 months ago #20786

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
try:
        var template = '<span class="hotspots-title">{{{title}}}</span>'
                + '<div>{{#thumb}}<img src="{{thumb}}" alt="{{title}}" class="hotspots-thumb"/>{{/thumb}}{{#description}}{{{description}}}{{/description}}</div>'
                + '<div class="clear-both"></div>';

Description field 11 years 6 months ago #20787

  • Imtiaz Noor
  • Imtiaz Noor's Avatar
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 7
  • Thank you received: 0
Awesome, works well, thanks very much.

Description field 11 years 6 months ago #20791

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
  • Page:
  • 1
Time to create page: 0.133 seconds