Turn off 2sxc Content Item Title as Module Title - dotnetnuke-7

Is there a way of turning of the 2sxc feature that replaces the module title with the Content Item Title (in the case of a list, it seems to use the Title of the first Content Item in the list)
Thanks!

Set the ListContent title.
If you have a list, then you must have two Content Types set: 1 for the Content item, and 1 for the ListContent. If you have a Title in the ListContent, that will set the module title.

Related

Directus many-to-many display template not showing up

I'm not sure where Display Template option is supposed to show up on M2M relationships.
Here on movies collection setting up genres:
and the options
Docs seems confusing about the distinction between Visible Columns and Display Template:
Visible Columns sets the columns the interface shows (we're using name)
Display Template sets the columns the interface shows (we're using {{movie.name}})
Visible Columns does the above; in this example shows the title column in edit page for genres:
Alright, great!
But what about the template? maybe in the collection list?
no, just the count:
I've tried all these templates but nothing shows up anywhere:
{{title}}
{{movie.title}}
{{genre.title}}
{{genres.genre.title}}
What is the correct template here? Where is Display Template supposed to show up?
My collections setup:
movies
title text,
genres M2M (alias)
genres
title text
movies_genres
id pk,
genre numeric,
movie numeric
Thanks
This applies to O2M Interfaces:
Since there can be more than one related item linked, in the items list, the display template is rendered as a number of items until you interact with the item...
If you place your mouse over the Genres Fields, you should see the display template rendered.
A popover should show up and display the list of items as you defined.

The method getKids() is undefined for the type PDField

https://issues.apache.org/jira/browse/PDFBOX-2148
When there are multiple copies with the same field name, the getFullyQualifiedName for each kid in the list of PDField objects returns the name of the parent, followed by .null. So if the parent field is called Button2 and it has 4 instances the result of printing out all the names will be:
Button2.null
Button2.null
Button2.null
Button2.null
According to the comments to the question, the OP refers to PDFBox 2.0.x versions, in particular 2.0.6.
getKids()
The method getKids() is undefined for the type PDField
In PDFBox 2.0.6 there are two immediate sub-classes of PDField. Different variants of the former (1.8.x) getKids() method are implemented in there:
PDNonTerminalField - the method retrieving the kids in this class is getChildren() and returns a List<PDField>, a list of form fields.
PDTerminalField - the method retrieving the kids in this class is getWidgets and returns a List<PDAnnotationWidget>, a list of widget annotations.
name of the parent, followed by .null
When there are multiple copies with the same field name, the getFullyQualifiedName for each kid in the list of PDField objects returns the name of the parent, followed by .null
This is not the case in PDFBox 2.0.x.
In the sample document attached to the PDFBox issue PDFBOX-2148 PDFBox now correctly finds only a single field which appropriately is named "Button2". This field is a PDTerminalField and has 4 widget annotations. The class of the latter, PDAnnotationWidget, has no getFullyQualifiedName method, so there are no ".null" names.
Thus, this problem is gone.
FQN of duplicate fields
(from the OP's comment responding to "What exactly is your question?")
how to get Fully Qualified Name of duplicate fields in pdfbox
There are no duplicate fields in (valid) PDFs, for a given name there is at most a single field which may have multiple widgets. Widgets do not have individual FQNs.
Thus, what you call "duplicate fields" in your example document actually is a single field with multiple widgets; the name of that field is "Button2" and can be retrieved using getFullyQualifiedName().
which page which form field
(from the OP's comments to this answer)
but how to get current page no in pdfbox.. for example there are 3 page and in page 2 there is a form field so how can i get which page which form field ?
All PDAnnotation classes, among them PDAnnotationWidget, have a getPage() method returning a PDPage instance.
BUT: As specified in ISO 32000-1, annotations (in particular form field widgets) are not required to have a link to the page on which they are drawn (except for screen annotations associated with rendition actions).
Thus, the above mentioned method getPage() may return null (probably more often than not).
So to determine the respective pages of your widgets, you have to approach the problem the other way around: Iterate over all pages and look for the annotation widgets in the respective annotation array.
For PDFBox 1.8.x you can find example code in this stackoverflow answer. With the information given in the previous parts of this answer it should be easy to port the code to PDFBox 2.0.x.
checkbox and radio button
(also from the OP's comments to this answer)
one more issue if i am using checkbox and radio button both then field.getFieldType() output is Btn for both. how to identify it?
You can identify them by inspecting the field flags which you retrieve via fields.getFieldFlags():
If the Pushbutton flag is set (PDButton.FLAG_PUSHBUTTON), the field is a regular push button.
Otherwise, if the Radio flag is set (FLAG_RADIO), the field is a radio button.
Otherwise, the field is a check box.
Alternatively you can check the class of the field object which for Btn may be PDPushButton, PDRadioButton, or PDCheckBox.
Beware: If a check box field has multiple widgets with differently named on states, this check box field and its widgets act like a radio button group! And not only in theory, I've seen PDFs with such check box fields in the wild.
To really be sure concerning the behavior of the fields, you therefore also should compare the names of the on states of all the widgets of a given check box.

How to identify individual controls within a search result using Selenium Webdriver?

I have a list of search results in the following link and would like to know on how can I identify the individual controls using dynamic xpath
http://www.bigbasket.com/cl/fruits-vegetables/?nc=nb
I'm able to get the list of product names displayed using the below line
List<WebElement> productResults = browser.findElements(By.xpath("//*[contains(#id,'product')]/div[2]/span[2]/a"));
I'm able to print the product names displayed in Page 1 using the below code, but however the list size is not matching with the list of results displayed in Page 1 so which I see blank lines in between when printing
System.out.println(productResults.size());
for(int i=0;i<productResults.size();i++){
System.out.println(productResults.get(i).getText());
}
Also I tried to locate the individual controls such as Qty text box, Add button in a similar like how I located the product names but the list count is not matching so which I cannot specify the quantity, add the required product to the cart.
Could you please help me with this one?
The first step is get only the visible itens (that is displayed), sou you can use this xpath:
"//*[contains(#id,'product')][not(contains(#style,'display:none'))]/div[2]/span[2]/a"
Now, you need to return the main iten div, that allows you to acess other functions. You can get the tag parents in this way:
"//*[contains(#id,'product')][not(contains(#style,'display:none'))]/div[2]/span[2]/a/../../.."
The elements that you recieve in this last XPath have all html itens that you want, as set quantity, select the dropdown etc. You can acess each using a findElement() in each IWebElement of the list. Example:
List<WebElement> productResults = browser.findElements(By.xpath("//*[contains(#id,'product')][not(contains(#style,'display:none'))]/div[2]/span[2]/a/../../.."));
for(WebElement element : productResults ){
IWebElement quantityInput = element.findElement(By.XPath("//input[contains(#id, '_qty')]"));
string quantityValue = quantityInput.getAttribute("value"); // if you want to know the current value. YOu can also parse it in an int
IWebElement addButton = element.findElement(By.XPath("//a[contains(#class, 'add-button')]"));
// etc to all elements inside element.
// Remember: Element is yout complete card of the item, that contains Value, name, image, buttons and all it.
}
Sorry for some Java syntax error. I am not a Java developer / tester. My piece of cake is C#.

How can I have multiple instances of same dojo form element with same id in a page?

I have a page say profile.htm with dojo declarative form with id="myForm". I have another page say dashboard.htm having border layout with 3 content pane. I want to show the profile.htm in all these three contentPanes. But when I try this then it gives registration error because there will be three forms with same Id.
Is there any solution for this so that I can have same page (with same id) in many contentPanes?
You simply can't, it's because of the HTML spec:
The id global attribute defines a unique identifier (ID) which must be unique in the whole document.
See: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id
The same goes for dijit's, if there are many dijit's with the ID myDijit what would registry.byId('myDijit') return? Dijit has it's own method of assigning unique ID's just as long as you don't assign one.

How can I focus to a specific item which is in the bottom of the page in IDE

I am trying to select a specific item in a page which is at the bottom of the page. I want to verify that element is present and the same time I want to focus to that specific item.
How can I do this in the Selenium IDE?
I tried storeEval, but its specific co-ordinated which I don't want. I am looking for some dynamic command. I tried using css:.groupTile:contains("Concentrated") but the focus is not going to that particular item (Concentrated).
Can someone help me with Command, Target and value please?
CSS Selectors have many formats
i) Using id. Put this in Target: css=tag#id
tag = the HTML tag of the element being accessed,
id = the ID of the element being accessed
ii) Using class. Put this in Target: css=tag.class
tag = the HTML tag of the element being accessed,
class = the class of the element being accessed
In value you enter name of the item.