Accordition Menu expand on specific URL - accordion

The accordition menu has some top level items, these items when clicked just expand the corresponding section of the menu. Is there a way these expansion to be triggered when URL contains some keyword? For example: When URL contains the keyword "dog" the top level "animals" auto-expand.

Ok I fixed my issue using the following:
$url = 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
if ((false !== strpos($url,'dog')) && ($li->hasClass('animals'))){
$li->attr('class', sprintf('level1 animals active'));}
Like I needed when the keyword dog exists in url the "animals" menu is set active.

Related

List view new record category label name TYPO3

I create some custom content elements with tt_content, typoscript and tsconfig etc. in a config extension. All works nice.
When changing to list view my custom content element gets listed under 'pen', which seems to be derived from either the extensionname or a table.
How can I set this name? See image.
You're right that the shown text depends on the table indirectly.
Here is the essential code shown how the name is determined depending on the table-configuration in TCA:
$temp = explode(':', substr($v['ctrl']['title'], 9 + strlen($_EXTKEY)));
$langFile = $temp[0];
$thisTitle = $lang->sL('LLL:EXT:' . $_EXTKEY . '/' . $langFile . ':extension.title');
This snippet is copied from the file typo3/sysext/backend/Classes/Controller/NewRecordController.php in the method renderNewRecordControls().
So in the end the text is determined in the language file(s) of your extension.

Access Search Subform + Update Query Subform?

So I'm new to Access 365, and I'm working on a database for my church's cemetery. I have a "main" form that will house searches and the results of said searches (https://i.imgur.com/v6ZmDx2.png).
So I'd like to put a box on this form that when I press the "Run Query" button, updates with all records matching the criteria. I have the query working, and if I go into the individual search form and search, it works fine.
If I try dragging the query onto the main form, I get a SearchQuery subform, but when I go into form view, I have to fill out data before the form even loads. I need it to only update after I click the button, so that I can enter info, THEN search (https://i.imgur.com/6jJ416o.png & https://i.imgur.com/XPPpg6S.png). If I click cancel, it loads fine, but when I type in data to the search then press "Run Query", it still prompts me for the info (https://i.imgur.com/FKbZ6WK.png).
Thanks in advance!
Your code is constructing criteria with control names as the data to search in, must use table field names. Remove the Result_ from each expression.
Coffin and Cremation radio buttons are within an OptionGroup control. This means you must test for the value of the OptionGroup, not the controls within the group. Clicking radio button sets value of the OptionGroup control. Following is revised code for the OptionGroup and checkboxes. Note removal of Result_ - fix the other conditional expressions as well. Might want to rename the OptionGroup control.
'Coffin/Cremation
If Not IsNull(Me.optGroup) Then strFilter = strFilter & "([Coffin/Cremation] = " & Me.optGroup & ") AND "
'Veteran
If Not IsNull(Me.Veteran) Then strFilter = strFilter & "([Veteran] = " & Me.Veteran & ") AND "
'Monument
If Not IsNull(Me.Monument) Then strFilter = strFilter & "([Monument] = " & Me.Monument & ") AND "
Why is the Clear Search button using EmbeddedMacro? Code to clear search parameters:
Private Sub cmdReset_Click()
'Purpose: Clear all the search boxes in the Form Header, and show all records again.
Dim ctl As Control
'Clear all the controls in the Form Header section.
For Each ctl In Me.Section(acHeader).Controls
Select Case ctl.ControlType
Case acTextBox, acComboBox, acCheckBox, acOptionGroup
ctl.Value = Null
End Select
Next
'Remove the form's filter.
Me.FilterOn = False
End Sub
Consider using comboboxes instead of textboxes to help users enter valid data. Can still allow any input and use LIKE/wildcard. RowSource SQL could be like:
SELECT DISTINCT [Last Name] FROM A ORDER BY [Last Name];
Advise not to use space nor punctuation/special characters (only exception is underscore) in naming convention.
You can access any form from the subform as follows:
MainForm: LOAN SETTLEMENT FORM
ex:
Forms![LOAN SETTLEMENT FORM]!txtEMP_ID.Value = Me.EMP_ID.Value
Forms![LOAN SETTLEMENT FORM]!txtEMP_NAME.Value = Me.EMP_NAME.Value

using Serenity-js framework ,how to locate a shadow element whose parent has an id which is a normal DOM

please tell me how i can locate an element in the below form using serenity-js Target.
Below is my Dom to the page i am trying to automate.
so here its a dropdown which you can see as which has id="splc" which is a normal DOM .. but the content inside that dropdown are all shadow elements.
my requirement is to access the content in dropdown.
Now i am not able to even click on the dropdown by normal xpath on px-component tag ( which is normal DOM) .
Inside that px component tag I can see that it has a shadow element #label which is exact element i need to click.
Problem is in my html page , all the dropdown has the same #label as the shadow element and their parent is a normal xpath with unique id.
When i use the Jquery on the chrome console
$("html #splc /deep/ div#label").click()
i can click the desired dropdown.
But how can i do the same with serenity-js frame work.
i want to do the below functionality that i have in protractor using SERENITY-JS concept .
static dropdown = element(by.id("splc")).element(by.deepCss("#label"));
Since serenity-js expects a target always since the Task needs that in activity. How can do the same ?
please help me.
From what I can see, by.deepCss is nothing more than a wrapper around by.css:
deepCss(selector: string): Locator {
return By.css('* /deep/ ' + selector);
};
If that's the case, then the following:
element(by.id("splc")).element(by.deepCss("#label"))
could be represented as:
element(by.css("#splc /deep/ #label"))
as per your jQuery example.
Now, if the above works, you should be able to define a Target as follows:
const Dropdown = Target.the('Dropdown').located(by.css("#splc /deep/ #label"))
Hope this helps!
Jan

the onclick of a table row is also working on a textfield inside that row?

On the categories page Where all the products are listed in rows and each complete row is a link to that product details page.
In that row I have created a textfield and a submit button but the product details link is also working on the textfield which I does not want.
When I click in the textfield for writing something in it, it redirects me to the product details page and I am unable to write something in the textfield.
So How will I handle it so that I could write some value in textfield?
This is just because of zen cart default code to redirecting user in case of clicking product row.
yo can change default behavior by two ways :
Use JavaScript/JQuery
you can use below code to prevent default action while someone click on textbox
<script>
$(".sortTextBox").click(function(event) {
event.preventDefault();
});
</script>
Manually change code in PHP file
you need to change product listing code in categories.php file located in admin folder of zencart.
Or, since you're changing the way the admin interface works, you could expand your changes to also remove the action that allows clicking on that table-row to be a quick access link to the details of that product (which is where editing of that product's information is normally handled).
For example, the onclick event in these code snippets would need to be removed:
echo ' <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . zen_href_link(FILENAME_CATEGORIES, zen_get_path($categories->fields['categories_id'])) . '\'">' . "\n";
and
echo ' <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . zen_href_link($type_handler , 'page=' . $_GET['page'] . '&product_type=' . $products->fields['products_type'] . '&cPath=' . $cPath . '&pID=' . $products->fields['products_id'] . '&action=new_product' . (isset($_GET['search']) ? '&search=' . $_GET['search'] : '')) . '\'">' . "\n";
And then you'd have to use the (e) edit button to gain access to the actual normal product edit screen, instead of the luxury of clicking anywhere on the row.

How to highlight parent of the current page?

How can I hightlight the parent menu item of the current page?
I have a site map as follows:
val siteMap = SiteMap(
Menu("Home") / "index",
Menu("Search") / "search" submenus (
Menu("Search Results") / "search-results") >> Hidden)
and I use it as follows:
<lift:Menu.builder ul:class="tabs" li_item:class="selected" />
However, when I navigate to the /search-results - the search menu item is no longer selected (i.e. the css class selected is no longer applied to it).
Any tips?
it's quite simple. You should use Lift built-in snippet Menu parameter li_path
something from documentation:
li_path - Adds the specified attribute
to the current page’s breadcrumb trail
(the breadcrumb trail is the set of
menu items that are direct ancestors
in the menu tree)
so in your code, you could do just:
<lift:Menu.builder ul:class="tabs" li_item:class="selected" li_path:class="selected" />
Hope this helps. If you could have any other questions just ask :)