How do I make a field required if another field has content in Expressionengine - field

I have a channel fieldgroup called blog
This fieldgroup has 3 fields
{body}: Textarea, required field
{image}: file field, optional field
{image_credit}: text field, optional field, that turns into a required field, when {image} has content.
Rationale behind this: An entry can be text only, but if an image is published it has to have credits.
As far as I´m aware of, this can´t be done natively with EE and I searched Devot-ee for an add-on, but to no avail.
I´d like to have this fixed on the field level. Ohterwise I have to write some code in the template, that will check for if {image_credit}=="" don´t publish any {image}. But this will lead to confusion, as why an image, that is shown in the CP will not be published...

I don't know of any way to do this natively or with an addon, but an addon may be out there.
I'd suggest writing your own jQuery validation. You can pop it into the instructions for one of the fields on that channel form. Should do the trick nicely

If you have Pixel&Tonic's Matrix add-on installed, you could create a new Matrix field in this Channel's field group.
The Matrix field has zero rows by default, and contains two field columns within:
Image field for the pic (required)
Text field for caption (required)
So, if there's an image with this entry, the client clicks the plus icon to create a row, and must fill in both the image and caption. If there's no image, they leave it as is.

Pixel & Tonic also have this addon which enables you to add your own custom js to the control panel. So you could do a check to see if the image field has content and then prevent the form from being submitted if the caption field is empty.

Related

How to create dynamic hyperlink using Field Codes in MS-Word?

I am trying to add a hyperlink to a field code in MS-Word, but I want the same field code to populate as part of a search query in the url. More relevant info below:
For Instance, this field code is linked to a form and will populate with a tracking number pulled from an inventory database «TrackingNumber», but then I want to link this generated tracking number into a url query is as follows:
HYPERLINK "https://www.google.com/searchq=«TrackingNumber»"
Is this even possible? And if so, how should I configure?
By default, if you insert a mailmerge field into a hyperlink field, the hyperlinks will all show the first record’s address as the 'Text to display' text, even though the hyperlinks will actually point to the merged targets.
Here's how you can do get a mailmerge to display your preferred default 'Text to display' text instead:
Disregarding mergefield issues for the moment, insert a hyperlink into the document in the normal way, choosing whatever 'Click Here' text you want in the 'Text to display' box.
Select the inserted hyperlink and press Shift-F9 to expose its field code.
Replace everything in the field between '=' and '"' with your «TrackingNumber» mergefield.
Select the field and press F9 to update the display.
In Word 2007 & later, you can make the display text variable also, by following these additional steps:
Position the cursor anywhere within the display text.
Insert a mergefield pointing to whatever data field you want to use for the display text (this could even be the «TrackingNumber» mergefield).
Delete all of the previous display text either side of your last-inserted mergefield (note that this field will likely have updated already).
Execute the merge.
After merging to a new document, use Ctrl-A, F9 to update all fields. Without this, the mergefield hover text won’t update to the correct targets.
Note 1: The above is only for merged output sent to a new document; it does not work with merges to email or print. For merges to email, see: https://support.microsoft.com/en-us/kb/912679
Note 2: Hyperlink fields modified this way are liable to cease functioning once the merge has been executed. Accordingly, it's best to save mailmerge main document before doing the merge and not re-save it afterwards. If you need to make changes to the mailmerge main document, don't make/save them after doing a merge; make/save them beforehand.

creating custom field in jira

I can't find a way to create this kind of custom field in Jira..
What is the custom field type for this kind of custom field?
I have tried with Label types, Select List(multiple choices)
type custom fields, but no result..
Having looked at their documentation and the applicable comments, it is indeed a Label field-type, as one would naturally assume.
The drop-down next to the labels is for the list of available or suggested labels.
this url may help you if you are using jira cloud
Link here
if you are using jira datacenter or jira server then
you must have admin access
go to the setting cog icon at the left side of screen .
go to the issues then click custom field in the left hand side
add custom field
Search label as in pic

Has anyone created a Label, Divider, or Instructions FieldType for Umbraco Contour?

I am surprised there isn't an Umbraco Contour field out-of-the-box that lets form editors write RichText or at least plain text instructions in-between the form fields, so that form authors can add more detailed instructions scattered throughout a form.
Does anyone know if this exists?
I found this suggestion in 2011: http://our.umbraco.org/forum/umbraco-pro/contour/22661-Place-plain-text-in-contour-form
My first attempt, I put together a custom field for Contour 3.0.21 and Umbraco 7.1.x, but I am not too keen on how the form results table now has an empty column. Instead, I would prefer that the content is placed in the form without creating a column in the result table, and also without emailing an empty field in the "Send Email" workflow email.
Have you tried taking a look at the Contour Contrib project for Contour?
http://our.umbraco.org/projects/developer-tools/contour-contrib
There is a Label fieldtype there that I believe does what you're looking for. If it does, you can get the source for that project and use that to create more field types that meet your needs. I hope that helps!

Add alternative text to a phrase in a document file

I use LibreOffice Writer and I want to insert an alternative text to a specific phrase in the document, how can I do it?
Example if we have an image in the document we can make double left click and add the alternative text like this:
Is it possible to make the same if we select a whole phrase of text? If yes how? And if No is there any other proposal?
The alternative text in 'word'/odt documents is actually intended as the 'alt' attribute in HTML (web) pages:
The alt attribute provides alternative information for an image if a
user for some reason cannot view it (because of slow connection, an
error in the src attribute, or if the user uses a screen reader).
(http://www.w3schools.com/tags/att_img_alt.asp)
It's only purpuse is thus to provide the user with information in case he/she can not view the image. Since having alternative text in case some text cannot be displayed is, well, silly, this 'alt' attribute is not defined for pieces of text. Alternatively, you could have a hyperlink pointing to nothing ("#"), which does provide a tooltip attribute.
What is it that you're intending to achieve anyway? It's not going to show up on any prints, which is the intended purpose of Writer... Footnotes (for prints) or Comments (for communication with co-editors) might suit you better.

How can I add text to a work item

We have a few bugs and change requests which have a complicated iteration path. This results in people coming over the team to ask 'Where do we raise items' a lot.
As you can't set a default value for the iteration path in TFS 2010 we think the best solution would be to add a string of text under the field which we can manually update every 7 weeks with the correct area to raise items in.
However TFS doesn't seem to allow just a line of text on its work items as a control. Is there a way to add a line of display text i.e. Not a field you edit, but just to inform those writing the items?
Please note that it needs to be visible at all times, using the tooltip 'help text' field on a control is not enough in this case.
You can use the LabelControl for this purpose.
You can not have a default in the work item for the iteration path, but what you can do is making use or the template url in web access or the work item templates in the power tools to create a work item that is prepopulated with values.
What about a custom field with a display control in read-only? You can give a default value to the field and the "read-only" control prevent other to change it.

Resources