How to find a particular Sublayout assigned to which content item in Sitecore.? - find

I have one Sublayout called "A" and i have more number of Content items. I just wanted to find out which content item that "A" Sublayout assigned to. How can i do this.?

You can select chosen sublayout in your content tree, and select Links option from the Navigate tab in ribbon:
You will see all the items which links to your sublayout.
Be aware, that if you see any __Standard Values item in that list, your sublayout may be also used by items which use that template.
Screenshot is from Sitecore 8, but it works the same in Sitecore 7.2.

Related

In Azure DevOps, is there a way to hide Iteration and Area fields in custom work item types?

In Azure Devops, using Customize option, you can add/modify fields except the Title, State, Reason, Area, Iteration Path. Is there a way I can modify a custom work item type to remove these fields as well?
No, these are system fields. There are headers elements that we'll have on each work item type:
Fields: Work item ID, Title, Assigned To, State, Reason, Area Path,
Iteration Path, and tags
Pages: History page, Links page
, and Attachments page.
Is there a way I can modify a custom work item type to remove these
fields as well?
System controls like Area Path, Iteration Path and Reason can be hidden from work item form using Rest API. In additon to hide them, lables to these controls can also be edited. You can not hide Title and State. Here are the steps:
Get the process ID
Get https://dev.azure.com/{Organization} /_apis/work/processes?api-version=6.0-preview.1
Update a System Control
PATCH https://dev.azure.com/{organization}/_apis/work/processes/{processId}/workItemTypes/{witRefName}/layout/systemcontrols/{controlId}?api-version=6.0-preview.1
Request Body:
{
"visible": false
}
Result:

What's this red "A" on my property?

This is a property in an ibd diagram using sysml1.3.
I don't know what this red letter A is in the low right corner. It's the only item that has it. I guess I have done something to get it but I don't know what and googling it has not given any answer. Can someone explain it?
It contains an attachment (Linked Document). Use Ctrl-Alt-D to view it. Use the context menu to delete (or edit) it.
I would just add that in some cases by default EA (v 14) can open document like diagrams - in full view, especially for CTRL+ALT+D shortcut (or right click on element with Linked Document and after selecting from context menu option Linked Document).
For below flows EA can open Dynamic Document tab by default, as preview next to the i.e. Element Properties, instead of Linked Document:
Start > Explore > Properties > Linked Document or
Show > Portals > Window > Document > Linked Document
Default Document tab by default instead of Linked Document
On Dynamic Document you won't find option to delete Linked Document:
Delete is not available for Dynamic Document
Just switch to the Linked Document, from hamburger select delete and that's it:
Delete is available for Linked Document

How to dynamically change dialog with select field

I'm new to Magnolia, and I'm making my own module.
I have a dialog box when adding a component and I want to change next fields below dynamically using a select field.
Example:
Select field with {"type 1", "type 2", ...}
IF "type 1" is selected
->show a text field below
ELSE
->show a basicUpload field below
Thanks in advance.
I believe same was already discussed here and few other places if you look over questions tagged "magnolia".
Long story short, fields are atomic, independent entities. They do not know about each other. So the only way to create such dynamic connection is over "parent" form. You need to extend form presenter and field factory (if you want select that would be SelectFieldFactory) and in there, when field is created, attach value changed or similar listener to it so when value is changed in the field, you can inform presenter to make some other field visible or hide it.
IIRC you can see example of that done in External Forms module (if you have access to enterprise code). Not sure if any of the community modules show the same.

How to control Show/Hide fields at Runtime in Orbeon Form Runner?

I have created a form in orbeon form builder which has three 30 questions which are belongs to 3 categories. Now I don't want to show all the 30 questions to every one also I don't want to create different forms for each category because all these categories belongs to one module.
While adding the form I have a drop down question like "Select Category". If user select the first category then I need to display only first category related questions and hide the second and third category related questions.
Is there any way to achieve my task in Form Runner?
UPDATE:
#ebruchez, I have followed your suggestion, I tried testing this feature on default "contacts" form. I have created a new text field in the contact form named "Account Related Field" as a label and "control-10" as Control Name. Below is the screen shot for the same.
Then After that I clicked on control setting of the "Account Related Field" and under the "Formulas" tab I have added the following XPath expression in "Visibility" section. $topic='Account' following is the screenshot.
After adding the path expression I saved the contact form and published. Then I tried opening the form in form runner. But I am not able to view the "Account Related Field" field on UI after selecting the "topic" value is "Account" in the form runner. This is the screenshot of form runner after publishing form in form builder.
Did I miss something. Please help to resolve the issue. I need to view "Account Related Field" field only if "topic" field value is "Account"
Thanks in advance.
Yes you can, by using a "Visibility" formula under the section settings. For example if your dropdown is named foo and has two entries, category1 and category2, then you can write:
$foo = 'category1'
to make the section visible only if the dropdown selected category1, and:
$foo = 'category2'
to make the section visible only if the dropdown selected category2.
This doc might help.

Find CURRENTLY selected <option> with XPath

What's the correct XPath syntax to check if an option element is currently selected, or just to get the selected option element from a select element, on an open page with which the user, and JavaScript, may have interacted? Is this even possible with XPath, or does it lack the ability to look at DOM properties?
I can't find any documentation on this, and have (speculatively) tried:
//option[#selected=true]
//option[#selected="selected"]
//option[#selected]
but none of these work; they simply don't match any elements.
(In case it matters, I've tried this both using the $x function in the Chrome developer console, and using the find_elements_by_xpath method in Selenium for Python.)
Short answer: it's not possible.
Longer answer: XPath can look at HTML attributes, but it can't look at DOM properties. Selecting an <option> element in a <select> changes the selected property of the <option> to true, and also changes the value property of its parent <select> element, but it doesn't affect the attributes of either, so it is invisible to XPath.
To find <option> elements that have the selected attribute set, which is often how a page author might determine which option is initially selected, you can use //option[#selected]. But this does not find the currently selected <option>; changes that the user makes to the selection are invisible to XPath. There's no guarantee it will even find the initially selected option, since it's possible that the page author didn't put the selected attribute on any elements and either let the browser select the first option by default or had some JavaScript select the initial option via the selected property.
The multiple other answers here claiming that a selector like //option[#selected] can detect selection changes made by the user after the page loads are simply completely wrong.
Of course, if you're able to use CSS selectors instead of XPath selectors, then option:checked will do the job.
The problem could be the " (double quotes).
//select/option[#selected='selected'] - Will match the selected option, i am using this successfully.
//select/option[#selected='selected' and #value='specific value'] - Will only match the selected option if it has a 'specific value', i'm also using this.
If you are still having trouble, it could be an entirely different problem, perhaps there is no option node. I hope this helps.
I think we can use a knowledge from #Mark's answer and account that. Let's just find a node which HAS desired attribute:
tree.xpath('//select/option[#selected]/text()')[0].strip()
I tried "//option[#selected=''] and it has worked for me.
it is able to highlight the selected option within Page objects model.
I would try //option[#selected='true']
i.e. driver.findElements(By.xpath("//option[#selected='true']")).getText();