I am new to Drupal. I have created a block that I want to show on some specific pages. Like if the url is "/node/2278" then I want to show the block for all the page under this "/node/2278". This may be /node/2278/1 or /node/2278/any-number.
You can use the Followings Path configurations
using (node/2278) -> the block will display only on node/2278.
using (node/2278/*) -> the block will display on node/2278/12 where * can be any text or number
using (node/2278/*/*) -> the block will display only on node/2278/12/45 where * can be any text or number
Use "/node/2278/*" , I think it actually tells you that the star can be a wildcard under the textfield where you enter it.
Don't forget you can set up url aliases so the path does not have to be "node/..." but can be whatever you want (admin/config/search/path/patterns)
Related
I'm trying to create a page type hierarchy where I can use it both a page hierarchy as well as props and evars, using the page URL. In a nutshell my URL would look something like this:
http://www.domain.com/BrandHomePage/SuperCategory/ProductCategory/Product
The mindset is to take the URL and use a data element to split the URL, and then capture the values into separate data elements that could also be used in a page hierarchy.
var url = "http://www.domain.com/part1/part2/part3/part4"
var parts = url.split('/').splice(2);
console.log(parts);
var baseUrl = parts[0];
var part1 = parts[1];
var part2 = parts[2];
var part3 = parts[3];
var part4 = parts[4]
My question is, would it even be possible to capture each individual portion of the URL into separate data elements? Or is my approach overkill.
Create a Data Element
The following will create a Data Element that returns an array containing up to 4 elements, depending on how many dir levels there are in the URL.
Go to Rules > Data Elements > Create New Data Element
Name it "hier1" (no quotes).
Choose Type Custom Script and click Open Editor.
Add the following code to the code box:
return location.pathname.split('/').filter(Boolean).slice(0,4);
When you are done, Save Changes.
Populate the Hierarchy Variable
Here is an example of populating hier1 on page view.
Go to Overview > Adobe Analytics Tool Config > Pageviews & Content
Under Hierarchy, select Hierarchy1 from the dropdown (this is shown by default).
To the right of the dropdown, in the first field, add %hier1%
Leave the other 3 fields blank.
Leave Delimiter as default comma , (it doesn't matter what you put here).
Note: DTM stringifies the returned array (String(Array) or Array.toString()) from the Data Element, which is effectively the same as doing Array.join(','). This is why the above shows to only put the Data Element reference in the first field, and the Delimiter is ignored.
If your implementation uses a delimiter other than a comma, see additional notes below.
Additional Notes
Populating other Variables
You can also reference %hier1% to populate other variable fields in the Global Variables section. Note that the data element will be stringified with default comma delimiter.
Alternatively, you may consider using Dynamic Variable syntax (e.g. D=h1) as the value, to shorten the request URL. If you are using the latest AppMeasurement and Marketing Cloud Service libraries, this isn't a big deal (the libs will automatically use a POST request instead of GET request if the request URL is too long).
Using the Data Element in Custom Code Boxes
You can use _satellite.getVar('hier1') to return the data element. Note that this returns an array, e.g. ['foo','bar'], so you need to use .join() to concatenate to a single delimited string value.
Using a different Delimiter
If your implementation uses a delimiter other than a comma (,) and you use the same alternate delimiter for all your variables, you can update the Data Element as such:
return location.pathname.split('/').filter(Boolean).slice(0,4).join('[d]');
Where [d] is replaced by your delimiter. Note that this will now cause the Data Element to return a single concatenated String value instead of an Array. Using %hier1% syntax in DTM fields remains the same, but you will no longer need to use .join() in Custom Code boxes.
If your implementation uses different delimiters for different variables, implement the Data Element per the original instructions in the first section. You may use %hier1% syntax in DTM fields only if the delimiter is a comma. For all other delimiters, you will need to populate the variable in a custom code box and use a .join('[d]').
Capturing more than Four Directory Levels
Since you are no longer trying to put a value in four hierarchy fields, you may consider pushing more levels to hier1 or other variables.
In the Data Element, change the 4 in .slice(0,4); to whatever max level of dirs you want to capture. Or, if you want to capture all dir levels, remove .slice(0,4) completely.
While filling a single Fabric.Path object , it fills completely and works fine!
Example,
Single Path Fill Example Image
But , when I fill a group Paths , they obviously act according to their Individual shape .
Example,
Group of Paths Fill Example Image
I'm using simple fill function of fabricjs.
Secondly , I have to avoid any change in their state. they must stay as a group of paths.
Is there something i did wrong?
Thanks!
Fabric does not support what you are trying to do.
enter image description here
We are automating the UI Application, Our UI application have Disabled Text are present, so we need to Validate the Disabled text. Before validating, I have to Print the Disabled text, Please guide me to how to print the text using Geb/Groovy.
Please find the Image of HTML tag which i highlighted is the Disabled text
BNSF0000712570
BNSF0000712570
The selector above will yield multiple results, i.e. elements, if there is more than one element that matches the classes used in the By.cssSelector query.
To get only the element containing "BNSF0000712570", I would suggest you try to get it using the "ext:qtip" attribute instead (which I assume is unique per element containing a disabled text) on the div containing the disabled text:
def myText = $(“div[ext:qtip=‘Id: 0001’]”).text();
println myText;
assert myText == "BNSF0000712570";
#Saurabh Gar: Why would you use the WebDriver "By" class selectors? With Geb you have access to a wide range of simpler ways to write selectors, e.g. like the one used above.
You should try using By.cssSelector as below :-
def text = driver.findElement(By.cssSelector("td.x-grid3-td-elementvalue").text
Or
def text = driver.findElement(By.cssSelector("div.x-grid3-col-elementvalue").text
assert text == "BNSF0000712570"
println text
Note:- If still doesn't get the text need to share table HTML insteadof screenshot that's why, could make a best locator.
Hope it helps..:)
Is it possible create an EXT-Solr index queue with pages inside PidInRootLine or Slide?
something like:
pages {
initialization = ApacheSolrForTypo3\Solr\IndexQueue\Initializer\Page
// all the regular stuff here
...
// only children or grant children of page 8
pidInRootline = 8
fields {
...
}
}
EXT-Solr does respect Page properties -> Behaviour -> Include in Search - Disable checkbox, so you can set on all the other pages this value. Just keep in mind that this checkbox might be also used for your SEO extension, but I assume it is OK, since you want to internally search only part of the tree.
I have an E-commerce website and have multiple products and images.
I want to add dimensions after every product images which have already uploaded.
Ex: product_name_1024x1024
Is there any way or I have to rename images 1 by 1.
I would recommended installing Netzarbeiter_NicerImageNames; https://github.com/Vinai/nicer-image-names
With this extension, you can define a mask for the image file names being shown on the frontend. Unfortuantely, it does not have a %width or %height attribute by default so you'll need to modify the extension.
I've taken a quick look and can point you in the right direction; add the filename variable as an argument to _getGeneratedNameForImageAttribute() so it will be _getGeneratedNameForImageAttribute($attributeName, $map = null, $forFiles = true, $fileName = null). Use getimagesize() to find width and height attribute when $fileName is not null and map 'width' and 'height' to these variables (see requestHost for example). Then look for every place in the code where _getGeneratedNameForImageAttribute() is called and add in the filename variable used within that function.
Finally, add the %height and %width variables to your map in the configuration under Catalog.