Filters Raw value in Views on multilingual site? - drupal-views

On Drupal8, I have a View who filter nodes from 2 parameters (each is a Taxonomy ID from different vocabulary). So I have a path like /filter1/%/filter2/% where filter1 raw value is the path component 2 filter2 raw value is the path component 4.
It works fine on the default language on the site cause there's no langcode in the url. But when I switch to a different language the langcode is added to the path and it becomes /zh-hans/filter1/%/filter2/% or /fr/filter1/%/filter2/%.
At this point the view is not working correctly anymore cause filter1 raw value is the path component 3 and filter2 raw value is the path component 5.
Anybody knows how to solve that?

After working around I find out that my question was dumb. The view didn't worked in chinese but it was not about the thing I mentionned. I take a look to the condition with a hook_views_query_alter and saw that the arguments where retrieved correctly in the url whatever language the page is in...
My problem was a I put a filter criteria on "Content: Translation language (= Interface text language selected for page)". I usually use it to display the result in the correct language. But in this case, it avoid results to display on other language than the default one. I don't understand why but it works without it and it serves the right translated nodes.

Related

Visio ShapeSheet ShapeData: keep two rows in sync

I have two Shape Data rows for a Shape's ShapeSheet:
Shape Data Label Prompt Type Format Value Invisible
Prop.Type "Type" "" 4 "Alpha;Beta;Gamma;Delta;Epsilon;Zeta;Eta;Theta;Iota;Kappa" INDEX(4,Prop.Type.Format) False
Prop.Abbrev "Abbrev" No Formula 4 "A;B;G;D;E;Z;E;T;I;K" INDEX(4,Prop.Abbrev.Format) True
The way I intent to use this is to have the user select the Type, say Epsilon, and then have the Abbrev automatically switch to the corresponding value in the Prop.Abbrev.Format.
Note: the values used here are placeholders for the actual values for my application, which are not shown here so they don't distract from the real answer I need, how to keep the selections in sync when the first one is chosen or changed.
Thanks for any help you can give!
I don't have Visio on this machine, so I am unable to copy and paste a working solution. The approach gets a little complicated, but extremely flexible.
Save your lists in the User section, rather than Prop - this then becomes underlying data for use in properties. If you are using a master stencil then this also helps with managing the fields.
You can now store an index in your data as well - this index points to the appropriate values in your arrays. You can use Actions and side menus to set the index which, when referenced properly, means you can have the full name and/or abbreviation in the side menu and the ShapeSheet does all the work underneath.
The functions you want to look at are:
Index (e.g. INDEX(1,User.Type) will return "Beta". (0-based)
Lookup (e.g. LOOKUP("D", User.Abbrev) will return "3". (0-based)
GetAtRef
SetAtRef
SetAtRefExpr
SetF
I had a similar business problem which relied on setting a background colour based on the value of shape data. Your final solution could end up including formulas like this: =SETF(GetRef(Prop.Type),"GUARD(INDEX(LOOKUP(Prop.X,Prop.X.Format),User.Type))").
For more in-depth discussion - check out https://superuser.com/questions/1277331/fillforegnd-in-shapesheet-using-wrong-data and the extended discussion at http://visguy.com/vgforum/index.php?topic=8205.15 - the latter link also includes an example file with working shapesheets (well, working to the extent that they exposed my problem).

TYPO3 Not able anymore to translate CE's to other languages

Is there a way to 'reset' or db entries to delete or something else without deleting all content already translated... (and would that solve the issue?)
In the first go all translation went well, I chose a 'one tree' setup pressing translate rather then copy, but adding and modifying the content over time certain elements where not available for translation anymore ...
at one point the second step in translation asked for the origin language (if I recall well) and trying to resolve I chose another language than the default, now I do not have the choice anymore and the record summary proposes elements from german rather than from my default language (italian) which might be the problem since I can only introduce new content in the default language.
if I try to localize from the list view clicking the language flag, in the language selection field I get [INVALID VALUE("1")] and as only option (Default) [0] to select ...
I use TYPO3 V7.6.13, EXT:gridelements and EXT:t3sbootstrap (the nested CE's where the first to show trouble)
content of my database table sys_language: (my default lang is italian)
uid | pid | tstamp | hidden | title | flag |
1 0 ... 0 English gb
2 0 ... 0 German de
does anyone know good reference or a solution to this problem ?
That sounds like your sys_language records (in yoour root-page, id = 0) are disabled or missing.
Those records make languages available for translation.
The other factor for translation selection is the translation of the current page. You need to have the page translated to a language (given above) to be able to translate any record in that page. That also is neccessary for pages which contain only data.
first check (as suggested by bernd) if your language setup is valid:
do you have a sys_language record for every added language in your
root-page ? (you can control the sys_language table with phpMyAdmin)
is the page translated ?
in my case that was all fine but I needed a thorough cleanup:
I deleted all hidden records in the backend
I activated the system extension 'recycler' and deleted all in the
list (from root-page recursive)
I then checked with phpMyAdmin which records in tt_content where
hidden (and did not show in the backend) and deleted those manually
once I did that the translate request answered perfectly and I could restore the missing CE's translations
note: I still had gridelements showing up in wrong sequence for the translation in the backend but correctly in the frontend, the nested CE's seem though, and of course 'CLEAR CASH FREQUENTLY' to avoid surprises ...

Setting Date as a prop in Adobe DTM

I'm trying to use Adobe DTM to pass the date to a prop variable but haven't had much success. The final output should be a prop report in Adobe that'll provide me traffic data for specific dates (5/11/16, 6/15/15 etc). The ultimate goal for setting the dates as a prop is to be able to classify a range of dates based on various business needs.
Could anyone point me in the right direction for getting this done? I am assuming I'll have to add a line of code in the s.code file that'll define s.prop5 = ...
Thanks
Based on your comments, it sounds like you are just looking to pop something with the current date stamp with "MM-DD-YYYY" format.
As Gigazelle mentioned, you can create a Data Element to return the value, and then reference it for setting your prop. However, throwing a data layer into the mix may be overkill for you, depending on your needs/limitations.
Data layers are meant for exposing data that DTM can't feasibly/reliably automate on its own via built-in features or hosting an autonomous js snippet.
The only reason you might want to consider having your site push it to a data layer, is if you want to generate the date via server-side coding to ensure the date is generated within the same timezone setting for all visitors. If you generate it client-side, it will be generated according to the visitor's browser/system settings. Since visitors are from all over the world in different timezones, the data may not be as consistent (even if you add additional code to change the timezone offset, it still may not be 100% based on browser version/security settings, or visitors who alter their browser/system date/timezone settings).
So, if you want to ensure the best accuracy, then I suggest you output the value via server-side code, and put into a data layer. How you do that depends on your server and what language you have at your disposal for your web pages being served up. Here is a very basic example using PHP:
<script>
var dataLayer = {
currentDate : '<?php echo date('m-d-Y'); ?>'
}
</script>
This will have the server generate the date stamp and output a js object called dataLayer with a property currentDate you can reference. You can create a Data Element as Type "JS Object" and for Path, put dataLayer.currentDate, and then reference your Data Element elsewhere (see below).
If that's too much trouble for you or if you want to keep it pure client-side/DTM and are okay with the potentially lower consistency...
Within DTM, go to Rules > Data Elements, and click Create New Data Element.
Name it "currentDate" (no quotes).
For Type, choose "Custom Script", and click Open Editor, and add the following:
var t=new Date(),d,m,y;
d=t.getDate();
d=d<10?'0'+d:d;
m=t.getMonth()+1;
m=m<10?'0'+m:m;
y=t.getFullYear();
return m+'-'+d+'-'+y;
Click Save and Close and Save Data Element.
Now you can reference the data element to pop prop5. How you do it depends on how you've setup Adobe Analytics within DTM. For example, if you set it up as a tool and only want it to pop on initial page view, you can open your AA tool config, go to the Global Variables dropdown, and set prop5 there. You reference it as %currentDate%
You can do the same %currentDate% syntax in a Page Load Rule or other rule or any other place that uses DTM's built-in fields.
Alternatively, if you need to reference it within javascript code (e.g. if you are setting prop5 within s.doPlugins or some other Custom Script box, you can reference the data element like this:
s.prop5 = _satellite.getVar('currentDate');
Set a JS variable on your site (such as within a data layer) that outputs the date in the format you wish to collect it in. Something like var d = Date();
In DTM, go to Rules > Data Elements and create a data element that maps to the JS variable you created on your site
If you want prop5 to be defined on every page, click the gear icon and map prop5 to your data element name by using %DataElementName% (whatever you named your data element in step 2, wrapped in percent signs). If you don't want it defined on every page, go to Rules and create a page load rule, event based rule or direct call rule depending on when you want the variable to trigger. Under the Adobe Analytics section of the rule, map prop5 to %DataElementName% .
This will allow you to collect dates as values, which can then be used in classifications.

How can we get value from DOM Properties in JMeter?

I'm trying to record a scenario of SAP CRM.
But I have a problem due to that everytime I login SAP CRM generates a new hashed token and will be used in URL like below:
See Image 1 Here
I tried to check where is the information stored, and in firebug and I found it in DOM tab:
See Image 2 Here
Is there any way to get the value from this DOM Properties using Jmeter?
Usually the choices are in:
CSS/JQuery Extractor
XPath Extractor
Regular Expression Extractor
Choose the one, you're most familiar with. Usually it is Regular Expression Extractor, however parsing HTML with regular expressions is not a good idea, moreover you will be very sensitive to DOM changes (part of the element goes to next line, attributes change positions, etc.).
So I would recommend choosing between CSS and XPath, but choose them wisely. I.e. if the number of styles on the page is not too big - go for CSS, if there are a lot of styles but the DOM itself is not very complicated - choose XPath.

How to change the SSRS input parameters position in report

My SSRS report contains 7 input parameters and while running my report the size of the parameter(i.e. length) is increasing.
One of my input parameter(drop down list) may contain 100 characters so the size is not constant but i want to place all parameters in 2 lines or 3 lines(in a row).
Now it is coming 2 parameters per a row
Please advice
As gbn indicates, it's not easy to change the built in report server method of presenting the parameters. SSRS likes to always use two parameters per line, presented in the order that they exist in the report (which must match the dependency order.)
So the alternatives that gbn mentions: Both involve building a "Wrapper" application: some custom code or a web page that you can code however you like to get the parameters. Then you call Reporting Services, either in code or by passing a formatted URL with your parameters. The report can be displayed in a frame, new window, or passed as a stream to where ever you'd like.
The URL access is pretty straightforward and reliable: I often use it either by hand (to create "favorites") or in code.
http://msdn.microsoft.com/en-us/library/ms153586.aspx
For what you are looking for, these might be more work than you expected, but they will be extremely flexible for your interface.
Jamie
You can certainly do that, just right click on the RDL file in the solution explorer and select view code. then move the XML tags named <ReportParameter Name="Nameofparameter"> under <ReportParameters> according to where ever you want to position. And then save it. thats it!!!
The report parameters are kind of floating in values of 2, so if u have 4 report parameters then it will be shown as 1,2 next line 3,4. Best of luck!!
Use ASP.NET for the paramaters and a ReportViewer control or URL access to render. Seriously.
I don't know of any option to present parameters any way other then the default
I believe you could try using jQuery. The report parameters are rendered in a table under a div tag with class sqlrv-ParameterContainer. Write a jQuery or JavaScript function that will extract the full innerHTML from this div ie. the table content and then extract the table row information like the <label> or <input> tags.
Create your desired table structure with <table><tr><td>{extracted sections}</td><td></td></tr></table> or leave it to your requirement...
Then just append this new HTML structure in place of the original default structure.
In jQuery it will be like
$(".sqlrv-ParameterContainer").html();
which will give you the entire table structure that comes inside the parameter. Use XML parsing and get the input controls and all. Extract these controls as-is, don't change anything.
$(".sqlrv-ParameterContainer table").remove(); // it will remove the SSRS rendered default table from DOM
$(".sqlrv-ParameterContainer table").appendChild('<table><tr>......</tr></table>'); // Append your custom html structure here....
This was something that came to my mind quickly... I would suggest you test it... :)
This doesn't help the OP with SSRS-2008 but in case it helps others - Microsoft have improved this in SSRS 2016 - parameters can now be easily managed via the GUI in Report Builder / Visual studio:
https://www.intertech.com/ssrs-parameters-2016-update/