What RegEx code do I need to leave something as-is - regex

I have a list of page names such as below:
Homepage
Product 1
Accounts
Sign In
Product 2
Campaign
Product 3
I want to use a calculated field in Google Data Studio to aggregate all Product pages. How would I write the code so that it still includes the other pages without manually inputting each individually? This is the code I have:
CASE
WHEN REGEXP_Contains ( Page Title, 'Product' ) THEN "Product Page"
ELSE [LEAVE AS IS]
END
What code would I write to leave the page title as-is but still including it? I feel like it's either something so simple or impossible and that's why I've been unable to find any answers. Would really appreciate any help!

I would guess just this:
CASE WHEN REGEXP_Contains ( Page Title , 'Product' ) THEN "Product Page" ELSE Page Title END

Related

I dont know how to pass two queryset parameters into one URL

I really struggled to explain my problem and the only way I found it would be possible is - through screenshots as I have a lot of code and I am not sure what is really needed here. So if you want any code, tell me I will add.
The numbers on the pictures indicate the order.
Choosing the category
Selecting the category it redirects me to - /products_list?category=(that category_id)
Filtering through brand in that category
Now please pay attention to the URL and what happens after I have chosen the brand I want to filter with.
Back on the first page
Problem is here:
Now I am back on the first page, where are all the products but I wanted it to stay on that URL where are that kind of category products.
What I wanted to happen? Instead of it taking me to the page where are ALL the products and then doing the filtering, I want it to stay on that category page and return the filtered products there.
The brand dropdown menu also should only show that category products that I am in, not all.
You need to pass the other parameters as well. So that means that for two parameters category_id and brand, you create a URL that looks like:
{% url 'product-list' %}?category={{ category_id|urlencode }}&brand={{ brand|urlencode }}
If you thus already filtered the category down, you pass the category_id to the template, and render the URLs with the ?category={{ category_id|urlencode }} part.

OpenCart 3 - Show all products in a category from a manufacturer by direct URL

[ Using Opencart 3.x]
I'm trying to make a link in the main menu to list products from a manufacturer that belong to a certain category.
Because i couln't find anything manufacturer related in the category controller, i tried to do it by also creating a category for each manufacturer like the text below, and then combining them into a link.
Manufacturers
Sony:
manufacturer_id = 13
manufacturer_category_id = 58
LG
manufacturer_id = 14
manufacturer_category_id = 59
Product category
tv_category_id = 60
The link i tried:
/index.php?route=product/category&path=59_60
But when i do this i get all the TV's from Sony, but also all the TV's from LG in the list.
Is there a way to do this right, so only all Sony TV's will be in the result?
There is no standard controller to make a link manufacturer && category. You don't need to create category for each manufacturer.
But! There is a way using standard OC3 filters.
Catalog - Filters. Here we creating filter, Filter Group Name "Manufacturer". Filter Values - "Manufacturer 1", "Manufacturer 2", ...(all your manufacturers). Save.
Catalog - Categories. Edit your category, which you would like to connect to manufacturer, i will call it "Your category". On the Data tab find Filters. Here, by entering first letters, select all filters ("Manufacturers" in your case), which you would line to link to this category. Save.
Extensions - Extensions - Modules. Find Filter, click Install, then Edit. On a filter module page set status "Enabled". Save.
Design - Layout. Find layout Category, click Edit. Add module Filter anywhere you want (for instance, under Category in Column left). Save.
Catalog - Product. Edit all product from a category you are working with. Editing the product, on the Links tab find Filters. Here, by entering first letters, select all one filter ("Manufacturer 1" in your case), which you would line to link to this product. Save.
That's all, go to "Your category" on the client side. There you will see a Refine Search module with the list of manufacturers. Check one of the manufacturers, click Refine Search. You will see the list on a products in "Your category" filtered by "Manufacturer 1". The URL is /index.php?route=product/category&path=58&filter=1. It's not a strict constant, if you adding new filters - order can be changed. But you can use it as a menu item link. Try. This should work.
Or you can use some other filter from Opencart Marketplace which can generate filtered pages with constant URL.

Reg Expression, Handling a URL exclusions

I am trying to write a regexp to use with Crazyegg that will allow me to only gather data from my product pages.
My site structure is:
category page: www.sitename.com/categoryname/sub-categoryname
product page: www.sitename.com/productname/
My regex so far is:
^https?://([A-Za-z0-9.-]*\.)?sitename\.com/[A-Za-z0-9.-]*(/|/\?|)$
This allows everything that isnt at the sub category level (2nd level folder?)
the issue is that this allow top level categories so I need to exclude these by their name for example:
^https?://([A-Za-z0-9.-]*\.)?sitename\.com/(?!\babout\b|\bcheckout\b)(/|/\?|)$
Could you please help me get the exclusion correct? ive also tried doing using [^\babout\b|\bcheckout\b]
if you only want product pages, the regex for capture product pages is:
".*productname"
For capture category pages: ".*categoryname/sub-categoryname"
I hope help you. If you have more questions, ask me!

Opencart: i need to search any product inside subcategories

I'm trying to create a menu with buttons that can filter products by main categories
This query url finds products inside a category:
/index.php?route=product/category&path=61
i can find only a part of products with a subcategory search.
/index.php?route=product/category&path=61_72_73
I need to NOT LINK products with their category parents, so is there a way to search with a subcategory filter?
I tried something like this:
/index.php?route=product/category&path=61&sub_category=true
But this doesn't work, it works only with textual searches like this one:
/index.php?route=product/search&search=chair&category_id=61&sub_category=true
ModelUse 'Advanced Product search for OpenCart'. You can search sub categories and any filters you add (including custom ones) with it.
http://www.opencart.com/index.php?route=extension/extension/info&token=460e88e8227b9d7e80466e026dbe1f64&extension_id=13605
I use it for a car dealer website with filters like year, make, model (and sub categories of those) etc and it works great for me.
Here's a demo link:
extension demo link
Try
index.php?route=product/search&search=%25&category_id=25&sub_category=true
25 is category id (which is not mandatory)
and search=searchterm is for a sting search in all sub categories
search=%25 means all products
search field name has changed at some of past version try this for 1.5.4.1
index.php?route=product/search&filter_name=%25&filter_category_id=20&filter_sub_category=true
and see here
http://demo.opencart.com/index.php?route=product/search&filter_name=a&filter_category_id=20&filter_sub_category=true

MediaWiki Template Templates?

Not sure I have the correct terminology here. I'll explain what I want to do and you guys can tell me if it's possible.
I'm using MediaWiki as a Customer List page. So, I have a category for customers, and for instance, I have 20 customers. Inside the actual customer page I have several "headings" that make up the customer page, including an infobox. What I'm wanting to know is, how I would go about "including" the headings as a template "Customer Landing Page". Meaning, each "Customer Landing Page" (Customer A or Customer B, etc, etc) has the same "headings", but not the same content - so all I want is that each customer page, I can include a "template" and it has the same headings with no content under the headings - so that each time I change this "template" file, it changes it on every customer, and all I have to do is edit the content on the customer page that is required.
You'll have to make one big template for the entire customer page, in which you put all the info. I'll make an example template for a page with two headers, "Customer Landing Page" and "More info". The headers are fixed, and the contents below it vary between customer page.
First, you make the template by creating the page Template:Customer
In here you put:
=Customer Landing Page=
{{{landingpagetext}}}
=More info=
{{{moreinfotext}}}
The triple accolades indicate the variables you will later define in each customer page. For customer A:
{{customer
| landingpagetext = This is the landingpage for customer A
| moreinfotext = This customer is a vegetarian
}}
Customer B:
{{customer
| landingpagetext = This is the landingpage for customer B
| moreinfotext = This customer likes Tom & Jerry
}}
The double accolades indicate the start of a template, and the first word is the templatename used. Then after each pipe ( | ) you can assign variables. I only used newlines to make it easier to read, you don't have to do that (but it makes it easier to maintain).
If you don't use the variable names (like {{customer|Landing page text|More info text}} ) you can access the variables by the order they are defined in, using {{{1}}} and {{{2}}} in the template.
If the customer pages are really big you might want to split the template up and use one per section.
Another option (but more complex) is the use of Navboxes. This requires a lot more set up but mayb be closer to what you are looking for?
You could look at using MultiBoilerPlate, I use this to set default text in pages. I would call this a template but Mediawiki uses that term for something else. If you just want to load the same default text when you start a new page and then fill it in with your own text, then I think this is what you need.