Forum Activity for @tig

TiG
@tig
07/19/18 10:02:24PM
184 posts

Newlines in database converted to HTML break for presentation


Jamroom Developers

I was reading with great interest a discussion close to this topic but it ended without a solution.

https://www.jamroom.net/the-jamroom-network/forum/jamroom-developers/38900/tinymce-inserting-line-breaks-into-some-list-items

One intriguing comment by Michael at the end was:

Quote:
TinyMCE will kindly reformat that so that its more readable
<h1>some big text</h1>
<p>then some small text</p>
and jamroom will go "Oh, you want an extra line in there and add a BR".

My question is which function of jamroom replaces the newline with a break? That is, when a comment is retrieved from the db with a newline, who is inserting the break before it is displayed?

Thanks,
TiG
updated by @tig: 10/18/18 05:44:57PM
TiG
@tig
06/14/18 09:19:01AM
184 posts

Conditional Form Fields


Jamroom Developers

SteveX

Created a reusable function based on your solution. Works perfectly. Thanks much for your help.

TiG
TiG
@tig
06/14/18 08:29:46AM
184 posts

Conditional Form Fields


Jamroom Developers

SteveX,

Adding javascript to the form is exactly what I would prefer to do. This little tidbit:

jrCore_create_page_element('javascript_ready_function',$_tmp);

is extremely helpful.

Thanks!
TiG
@tig
06/13/18 08:26:06PM
184 posts

Conditional Form Fields


Jamroom Developers

Michael

Excellent. Glad I asked. I will check this out - conditional form fields would be a great thing to have in my toolkit.

Thanks!
TiG
@tig
06/13/18 05:08:09PM
184 posts

Conditional Form Fields


Jamroom Developers

Anyone have a good practice for creating a form field that is enabled based upon an entered value in another field on the same form? For example, imagine having two fields that are both optional. Lets call them penalty_message and penalty_points. If the user enters a value in penalty_message we would want to reveal the penalty_points field to accept a now required integer value. Otherwise the penalty_points field would be hidden (or disabled).

( This is a simple contrived example. )

Of course one can show both fields as optional and handle problems in _save validation logic but that is not ideal. Much better to prevent the user from entering a value in (or even see) the penalty_points field unless it makes sense to use the field.
updated by @tig: 09/13/18 06:35:11PM
TiG
@tig
04/15/18 07:15:12AM
184 posts

Conditional Sitebuilder Menu Item


Jamroom Developers

Michael

Given this appears to be best addressed with template overrides and smarty functions (rather than a listener) I will adopt your approach. (Have written quite a few smarty functions at this point.) Your approach will provide plenty of options for future menu refinements (if need be). It also offers the option to encapsulate menu item changes within the modules which deliver the functionality.

Thanks,
TiG
TiG
@tig
04/14/18 04:47:15PM
184 posts

Conditional Sitebuilder Menu Item


Jamroom Developers

Nate

Okay, then based on your advice I probably should just bypass Sitebuilder menu altogether and bring the full menu into code. That will provide full (developer) flexibility for whatever might arise in the future.

Thanks,
TiG
TiG
@tig
04/14/18 01:25:51PM
184 posts

Conditional Sitebuilder Menu Item


Jamroom Developers

Nate

I agree. Been looking for something outside of SB to accomplish this. Ideally an event that would enable a listener to prevent the showing of a menu item.

Thanks
TiG
@tig
04/14/18 12:44:38PM
184 posts

Conditional Sitebuilder Menu Item


Jamroom Developers

Nate

Your answer is perfect if the condition is reflected in a quota. (I should have explicitly excluded that, sorry, my bad.) What I am looking for is the means to disable (or enable or even dynamically create) a main menu item (and sub-items) based on an arbitrarily complex condition expressed in code.

Thanks
updated by @tig: 04/14/18 01:06:23PM
TiG
@tig
04/14/18 12:14:09PM
184 posts

Conditional Sitebuilder Menu Item


Jamroom Developers

Is it possible to conditionally hide (or alternatively, conditionally show or dynamically create) a main menu item created using Sitebuilder?

The need is to show a new main menu item (in this case, 'Publish') only for users authorized to use publishing functionality provided by the sub-menu items under Publish. The Publish main menu item would appear only for those who are authorized.

updated by @tig: 07/17/18 04:13:01PM
  7