asp.net MVC3 Image breaks on Edit/Create pages, OK on Index - asp.net-mvc-3

I have a _Layout.cshtml page which I've used to include all "master page" styling. This page includes an image in my header which is mapped in the layout page as:
<img src="/Content/Images/Logo.jpg"/>
When I created the controllers, I selected the option to create a "controller with read/write actions and views, using Entity Framework" which generated my Edit, Delete, Create and Index views.
My image appears normally on the Index pages for all of my various controllers, however when I click on any of the the Edit, Create or Delete pages, the image breaks. Do I need to map the image differently on these pages, and if so, how do I change this? I was under the impression that all pages pulled content from the layout page the same way.

Try mapping the image like so:
<img src="#Url.Content("~/Content/Images/Logo.jpg")" />

Related

Liferay 7.2: Open asset publisher viewURL in a Display Page Template

I am using Liferay 7.2. I want to display the viewURL link of an asset publisher in a Display Page Templates page. I couldn’t solve the problem. After searching, I realized that this problem can be solved in three ways:
Method 1:
1- As and admin, in Web Content>Structures create a structure (News Article) and make a Template for that structure.
2- Create page A and add an asset publisher. In this asset publisher: In Asset Selection choose Web Content Article as Asset Type and choose News Article as sub structure. In Display Setting tab choose View in Context as Asset Link Behavior.
3-In Site Builder>Pages create a Display Page Template (page B). Edit it and add an asset publisher similar to page A. However, in page B, in Configuration of asset publisher, in Display Settings choose Show Full Content as Asset Link Behavior and tick Set as the Default Asset Publisher for This Page and Show only assets with Page B as its display page template.
4-Create some News Article. In Display Page Template section, choose Specific Display Page Template and Page B.
In page A, everything is OK. However, when I click on ViewURL of an asset entry, it will redirect to page B. But, in asset publisher section of page B, no results is shown (There are no results.). Means that the chosen asset of page A is not shown in Display Page Template of page B.
Method 2:
Maybe the simplest method is editing Display Page Template (page B) in Section Builder>Content Display add Display Page Template. However, as stated in this issue , the display page content section only shows the summary and no style can be shown. Maybe it is necessary to edit abstract.jsp file. But, I don’t know how to do this.
Method 3:
Create a Widget Template and add it to page B. The article data of the selected asset can be obtained from the URL. However, I couldn’t get the data of the selected article.
I appreciate for any help in this regard.
An Asset Publisher instantiated in a Display Page Template won't show the page Web Content. One way to show an Web Content in a Display Page Template, is to instantiate a Fragment and map the Web Content fields to it, as shown here.
So, to solve your problem, you would need to change Page's B Asset Publisher to one or more Fragments, and map your News Article fields to them.
You could also map the Web Content to your own custom Fragmets, using Fragments lfr-editable fields
<lfr-editable id="unique-id" type="text">
This is editable text!
</lfr-editable>
Another way is to get the Web Content Java Object instance inside a Freemarker (a Fragment, Widget Template, Web Content Template, etc) with this snippet (only works for 7.3+)
${Request.INFO_ITEM}

How to access a specific Joomla File

Within an article in Joomla, I have the following code:
(loadposition file_download)
This line of code loads more code, but I cannot access it from the Articles page. How do I access the loadposition code?
On the web you are always striving to separate content from display. Here you are just setting up the display so that when the page renders items in the file_download position will render. That is the html for whatever is in file_download will be generated dynamically when the user looks at the page in the browser. In the editor you are just creating html. If you save the article and view it in the rendered form (i.e. in the Joomla frontend) you will see that loadposition will do its work of rendering whatever it is that file_download asks it to render. That is loadposition is a way to dynamically include content (which might include text, javascript, whatever) into an article.

Oracle Apex - Can I edit layout of Individual Pages?

How can i edit layout of individual pages in Oracle Apex. I tried changing templates and properties in shared components but it applies to all the pages.
On one page, I need different layout of buttons and items and on the other page, a different.
You can create more than one page template, for different types of page. And you can also make page-specific styling changes using in-line CSS in the page attributes.
It applies to all pages, because all of your pages refer one template. And when you change this template, all pages changes. Create a copy of template, and then refer your individual page to this new template.

tumblr custom pages and ask page

I'm creating a custom tumblr theme. Both the ask (/ask) and custom pages (/whatever-you-want) seem to be considered text posts:
{block:PermalinkPage}
<div>THIS IS A PERMALINK PAGE</div>
{block:Posts}
{block:Text}
{block:Title}<h2>THIS IS THE ASK OR CUSTOM PAGE TITLE: {Title}</h2>{/block:Title}
<!-- BOTH /ASK IFRAME BOX AND CUSTOM PAGES ARE PLACED HERE -->
THIS IS THE ASK IFRAME OR CUSTOM PAGE BODY: {Body}
{/block:Text}
{/block:Posts}
{/block:PermalinkPage}
I want to have a totally different layout for the ask page and the custom pages (no headers or footers on the custom page, no title, etc) and I don't care about the (real) text posts, because I'm not going to use them. Is there a way to have a different content from the "/ask" and the custom page without using javascript? I have read the documentation, but don't see anything that would allow me to do that... Is this possible?
Yes!
Just create a new page (towards the bottom of the Customise options).
If you choose Custom Layout, you can add any html you want and it will be detached from the main template.
Here is an example: http://madox-test.tumblr.com/test
If you check the site root you can see the tumblr template: http://madox-test.tumblr.com (which can still be used for other pages too).
Ref: http://www.tumblr.com/docs/en/pages#layouts
Luke

Mixing asp.net mvc controllers/views and static content management pages from database

I'm trying to build my first page using asp.net mvc3/razor which will mix pages showing entities like a list of news items and pages loaded from database created from a wysiwyg form (=content management page, cm). Therefore I would like all cm pages to use the same controller/view.
One "ugly" way to solve it is using a Pages action on each controller but I rather have a way to lookup if the link is an action or should be loaded from DB. Can I create routes like that? And if I can should I or is there a better solution?
For example if I have this structure
Home (Controller)
News (Action, page built up dynamically using list of news items)
About (Action, page from db)
Contact (Action, page from db)
Calendar (Action, page built up dynamically using a list of calendar events)
Orienteering (controller)
What is orienteering (Action, page from db)
I would like the url to the About page to be /Home/About not Home/Pages/About and the What is orienteering to be Orienteering/What-is-orienteering. These two pages are created from a wysiwyg editor in the gui by the users.
The News and Calendar should be loaded like standard controller/view page.
The bottomline is that I would like a base set of dynamic pages displaying structured data and on top of that the users should be able to create new pages from that GUI that is not controllers/view but loaded directly from the database.
I could create a Pages controller but then the URLs won't mirror the menu the user is seeing.
What is best practise in this case? :)

Resources