How I can user current module id in visual designer - 2sxc

I have a module showing items from a query. I have a field for some entities adding current ModuleId, but I need to filter those entities in visual designer using ModuleId value. How i can get current ModuleId in Visual Designer.

I already found the solution, inside visual designer is possible to use token [Module:Id] this will work to filter entities with current module

Related

Updating default front-end design of Identity Login Page in .NET core

I am developing a .NET core application with Identity login which provides a Bootstrap form In the /Identity/Account/Login page.
I have imported Materialize CSS files in the wwwroot/lib folder and want to change the Login page's design with materialize css as well.
The problem is /Identity/Account/Login page doesn't exist in project structure. Then how should I approach to solve this problem?
One way would be to scaffold the login page, which would add it to your project structure. Then you would be able to make any changes you want. You would have to do the following (from the link I provided):
From Solution Explorer, right-click on the project > Add > New Scaffolded Item.
From the left pane of the Add Scaffold dialog, select Identity > ADD.
In the ADD Identity dialog, select the options you want (in your case Login).
Select your existing layout page, or your layout file will be overwritten with incorrect markup. When an existing _Layout.cshtml
file is selected, it is not overwritten.
For example ~/Pages/Shared/_Layout.cshtml for Razor Pages
~/Views/Shared/_Layout.cshtml for MVC projects
To use your existing data context, select at least one file to override. You must select at least one file to add your data context.
Select your data context class.
Select ADD.
To create a new user context and possibly create a custom user class for Identity:
Select the + button to create a new Data context class.
Select ADD.
Note: If you're creating a new user context, you don't have to select
a file to override.
Another way would be to look at the Login page source code and see HTML elements' ids and classes. Then you could override the default CSS by writing your own CSS that would be more specific than the default one.
From Asp.net Core 2.1, Identity UI code are not included in project structure.
You can see this line of code in StartUp file -> method ConfigureServices
services.AddDefaultIdentity<IdentityUser>()
.AddDefaultUI(UIFramework.Bootstrap4)
If you want to customize the UI, you have to generate this bunch of code by 2 ways:
1. Using Visual Studio: right click at project -> add -> new scafolded item -> identity -> and choose which you want to be generate.
2. Using CLI: from the project directory run this command-line
dotnet aspnet-codegenerator identity -dc WebApplication.Data.ApplicationDbContext
The default Identity pages you see are generated behind the scenes from this dll in your project:
Microsoft.AspNetCore.Identity.UI.Views.V3.dll
-- located here --
Dependencies >> SDK >> Microsoft.AspNetCore.App(2.2.0).
Follow #Marko Papic step by step instructions to generate the Identity pages (or partials) you'd like to override with your Material css. Within these (now view-able pages) is all the logic and naming references to the Identity classes, methods, properties etc you'll need to build your own custom page.
Additionally, you don't need to stick to the default Areas/Identity/Pages/Account... file location or razor syntax. You could, if you wanted to, create your own MVC versions, or vue.js in whatever file structure/representation you like.
I keep a project off to the side that has overridden all of the Identity UI pages ( checkbox Override all files that serves as a handy reference where I can bring over what I need as I need it.
#Marko Papic has provided a nice answer for you, I'l suggesst you select his answer as the correct one..

Create custom metadata Tags for documents to be uploaded in Alfresco

I am exploring with alfresco 4.3 & 5.0,
As we know our normal documents have metadata properties like Author,Title,Subject,Category.... & so on.
So if it has some values, alfresco retrieves data values from these & displays in that file properties section like :Name,Title,Author,size,creator......and many more.
So Suppose If I have a some more form fields in my document (like firstName,Tenant,isAuthrorized), then what are the all steps that I need to follow in alfresco so that whenever user will upload any document , under that file properties section, all the properties will get displayed and also If I will select edit properties option, I should be able to edit them.
I have followed this pdf :http://ecmarchitect.com/images/articles/alfresco-content/content-article...
By using which I am able to see new drop-down values under create rule section.
Similar way I want to do it document properties section, so that similar to existing properties like Name, Title,Description,MimeType,Tags... etc , I can also see my new properties like firstName,Tenant - all are text fields.
Please show me the way to achieve these things for Alfresco 5.0 a community . To achieve this do I need to import Alfresco sdk, or can I directly changes in tomcat?
Also one more question, I want to create a custom metadata in alfresco , so that if excel sheet(column)have values ,then all such properties with their values should be displayed under properties section of that file.
Is it possible in alfresco?
If yes can you provide me some way to do it.
You can create custom metadata in alfresco.For that in alfresco you can use alfresco content model.For reference you can study below link of alfresco.
https://wiki.alfresco.com/wiki/Data_Dictionary_Guide
Below are some basic information.
You will need to create 2 files for creating custom metadata.
1. Context file
2. Model file
Both files will be inside alfresco/extension folder.
There is one another approach for dynamic model creation.For that you only need to create one file which you will need to upload inside "/Data Dictionary/Models"

How edit code template ASP MVC 4 CRUD Generator?

I want to alter the default code genaration of MVC CRUD ASP . NET.
Visual Studio.It generates pages of "Edit.cshtml/Insert.cshtml/Delete.cshtml"
I want to translate "Edit" to "Alterar" - "Insert" to "Inserir", and I would like that the razor file to be called "Alterar.cshtml" instead of "Edit.cshtml"
How can I do that?
Is it possible?
Yes, you can.
Based on this excellent blogpost by Scott Hanselman I changed the default template in a few steps. The difference between Scott's approach and mine is that he apparently made it in a way that keeps the global default but gives him a separate generator for each project. Since I didn't get it working immediately, I opted to instead just change the global template.
Go to C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\ItemTemplates\CSharp\Web\MVC 4\CodeTemplates\AddController (some parts of the URI may vary in your situation
Optionally: grant yourselves write privileges on Controller.tt
Open Controller.tt in an editor of your choice and change what you want to change. Note that these are T4 templates so you have a wide variety of tools to your disposition if you want to do more advanced stuff.
Create a new ASP.NET MVC project
Go to the "Controllers" folder and add a new controller (not an api controller)
You don't have to change anything to get a differently named view: the view, including the file in which it is stored, is generated based on the name of the action method that creates it. If you generate the view from Alterar then the popup window will present you with the name "Alterar" for the file.

Access to the current page from in a Tridion component template

I realize this might be slightly counter intuitive... but in a compound component template, is there a convenient way to access the Page object or the TCM URI of the page being rendered? I realize the result might be null if the component template is being rendered into broker or being debugged using the template builder. But I would like to get the page id if it is available.
Yes, you can create a TBB to do this. If you look on sdltridionworld.com there are Generic SDL Tridion 2011 Template Building Blocks available: https://sdltridionworld.com/community/2011_extensions/generic-2011-tbbs.aspx
In there there is a handly file called TemplateBase with a method called GetPage. You can use it to get the page in a TBB and then push the Page ID to the package.
This is also covered (for a C# TBB) in this Stack Exchange question: https://tridion.stackexchange.com/questions/743/accessing-page-object-in-c-tbb-used-in-the-component-template

Browse for Project Folders in Build Template TFS 2010

I'm adding a new argument to my custom Build template. The argument is almost identical to the default Projects to Build argument under Required -> Items to Build. It simply shows a dialog window with a list of folders under current TFS Project. I can't figure out what the type of control is. I tried FolderBrowserDialog but it browses the computer rather than the TFS project itself. Any help would be appreciated.
You can set the Editor for this argument to:
Microsoft.TeamFoundation.Build.Controls.ServerFileBrowserEditor, Microsoft.TeamFoundation.Build.Controls
Or
Microsoft.TeamFoundation.Build.Controls.ServerFolderBrowserEditor, Microsoft.TeamFoundation.Build.Controls
See my blog for a detailed set of steps.
All of these types are Internal, so you can't reference them from your own code or see them easily. What you can do, is set them as Editor for a parameter you created in the Build Workflow. You need to specify Typename, Assemblyname. You can find these items in the MetaData section of your Build Template.
Add your argument to the workflow:
Open the Metadata property:
Set the editor for your property:
A multi-folder select dialog is not part of the Default UI Editors. You'd have to roll your own. Either use Reflector to see how the existing ones work, or use Reflection to invoke th existing editors as part of your new editor.
It's not going to be pretty code either way, but it would work.

Resources