Adding custom attributes to the SiteMap of ASP.NET MVC - asp.net-mvc-2

I am using built in asp.net sitemap in asp.net mvc with the following schema
http://schemas.microsoft.com/AspNet/SiteMap-File-1.0
I have the following attributes, resourcekey, title & description. I would like to add few more attributes to the sitemapNode, kindly let me know if it is possible to add new attribute in sitemap file and then read it via the sitemap class.

The SiteMap schema supports custom attributes and they can be accessed via the indexer property of the SiteMapNode class.
For example if the following node was defined in the Web.sitemap file with custom tooltip attribute:
<siteMapNode url="~/Default.aspx" title="Home" tooltip="My Home Page" />
It can then be accessed via the SiteMapNode indexer e.g.
string tooltip = siteMapNodeInstance["tooltip"];
More information on customising SiteMaps is available here

Related

Problem with file_list extension of Typo3

I am pretty new in Typo3 world.
I'm trying to list all the files in a folder and parse them one by one. To list the files, I'm using "file_list" extension (https://docs.typo3.org/p/causal/file_list/2.4/en-us/Index.html) and following the image gallery tutorial (https://docs.typo3.org/p/causal/file_list/2.4/en-us/AdministratorManual/ExampleGallery/Index.html). To this end, I have created a folder at "/fileadmin/user_upload/test" and created three empty files in it for test purposes.
I have created these 4 files just as described in the tutorial:
ext_emconf.php
ext_icon.png
ext_localconf.php
ext_tables.php
This is the content of my "Configuration/TypoScript/setup.typoscript" file:
plugin.tx_filelist {
view {
partialRootPaths.100 = EXT:my_gallery/Resources/Private/Partials/
}
settings {
path = file:1:/user_upload/test/
mode = FOLDER
}
}
I have also created MyGallery.html under "typo3conf/ext/my_gallery/Resources/Private/Partials" with the same content as in the tutorial.
I have the file "typo3conf/ext/my_gallery/Resources/Private/Templates/Default.html" which includes one line:
<f:render partial="MyGallery" />
In Typoscript backend, I have created a page with a template and included "My Gallery(my_gallery)" and "File List(file_list)" static extensions in it.
The setup section of the page includes:
page = PAGE
page.10 = FLUIDTEMPLATE
page.10 {
templateName = Default
templateRootPaths.1 = typo3conf/ext/my_gallery/Resources/Private/Templates
partialRootPath = typo3conf/ext/my_gallery/Resources/Private/Partials
}
Now my page renders the template and partial in the frontend (I could confirm this by injecting dummy content) but does not show any folder list. According to the HTML template, I assumed there should be a "files" variable passed to the page, but when I reviewed the debug information, I could not even find such a variable.
I need help to parse the folder content in the frontend HTML file.
Not tried it myself, but after a quick look into the documentations you linked.
Assuming everything was done corretly regarding the documentations, the point what you missed is following:
In the backend, in the page module, on any page create a new content element. There should be the filelist plugin. In the plugin option, there should be a option, where you can select your created "My Gallery" template.
Filelist is an extbase plugin. So it must be placed in a page. As alternative, you may add a typoscript to directly render a plugin instance into a template variabel, you can place / output in the template. Or in any template.
The first and easier option would be to place it in a page as content element.
If you want it as variable, you can create / rendet it as shown in the filelist documentation on https://docs.typo3.org/p/causal/file_list/2.4/en-us/AdministratorManual/BestPractices/TypoScript.html
If you add such a snippet to typoscript (propely modified to match your stuff).
You can render it in the page template with:
<f:cObject typoscriptObjectPath="lib.filelist" />
But this would display it on every page.
For the start, I would suggest to go the "put it as an content element on a page" way.
edit 1 / answer on your comment
Maybe something went wrong or you missed, when you followed the gallery exampel on https://docs.typo3.org/p/causal/file_list/2.4/en-us/AdministratorManual/ …
Would suggest to check every step clearly.
Things, which came in my mind:
missing include of the default static template from the filelist extension/plugin on the root page / root template record
missing include of the static template from your dedicated extension (like in the example)
wrong order of the static includes (eventully)
not enabled your dedicated extension
missing cache clear
..

How to tag pages and layout (not assets) in Liferay

I have a Liferay site. I have several pages that needs to be tagged so I can get them in a custom portlet.
I also need to present a page with an alphabetic index of the tagged pages.
I have read documentation and I have seen that Liferay can put a tag or a category only on "assets" (web content, etc.) and not on a page/layout.
Can you suggest me a way to do it?
You are right about tag/category, these can't be applyed to layout (unfortunately).
The best alternative is to use custom attribute and define the extra fields for the page.
See this image
You can read the custom attribute for the page using ExpandoBridge API.
Here an example to read an extra attribute within the theme velocity template.
#set ($customField= $layout.getExpandoBridge().getAttribute("CustomFieldKey"))
Note: Remember to set the permissions on each custom attribute. It's very important!

Adobe CQ5 set default page properties

Is it possible to set default page properties value in CQ5 when you created a page? Either by specifying it in templates, component, etc...
Found it, just need to add the attributes directly under
templates//_jcr_content

MVC2 and Google Custom Search

I am trying to incorporate google custom search in my MVC2 application. I have already registered for google custom search and obtained API key and other settings. I have an input type textbox on my view and a search button. How can now i pass the search string (from my textbox) to google API and receive the search result and show them on same or other view page? any related post, example would be a great help.
Implementing Search in ASP.NET width Google Custom Search looks like a pretty good match. As long as you don't do his conversion of the form markup Google provides to the form runat="server" webforms style markup it should work fine in an MVC context.

Giving a link in a asp.net mvc2 page for a non-mvc page ie, a asp.net webform

I tried to give link to my reports located in Reports folder under "Views". My problem is that I am unable to direct from a mvc page to myReport since it is looking for that page in controller, which doesnt exist. I have the route given in global.asax. am i missing something here?
my mapping to web pages is as follows
aspx page (contains relative path to the application eg:
<siteMapNode url="Managers/FindUser.aspx" title="Find user"/>
is translated as :http://localhost/Managers/FindUser.aspx
mvc page
<siteMapNode url="Managers/Management/" title="Management" />
is translated as :http://localhost/Managers/Management/