Rendering latest content with custom template in Orchard CMS - asp.net

I have a piece of content that is structured like this:
Body
Common
Containable
Route
And it also contains an Image Field
What I'm trying to do is display a summary on my landingpage containing only the Url and the Image Field Url (url the uploaded image), something like this.
<img src="#Model.Image.FileName" />
Obviously, I'm new to Orchard, and from reading other similar questions around the web I understand that perhaps I should be looking at the Placement.info file, however I'm unable to figure out how to use that in order to achieve what I need (which is an image wrapped in an anchortag).

You should be able to do that by creating a file called Content-TheNameOfYourType.Summary.cshtml in the views folder of your theme.

Related

Copy the contents of existing page to another page with different name in wordpress without using any plugin

I am new in WordPress. In my WordPress application having one page named "Retail". I want to create new page named "Website" with the same content of "Retail" page. I copied content and paste in to new page editor and saved. But some CSS problem is there. I think css file is missing kind. How to resolve this problem?
We cannot find the problem without any real information. However you can check if any of the following issues occurs:
You use a theme which let you add custom CSS rules in specific page. You might have a settings button in the page where you add it. In that case, you need to copy that as well.
You need to check your CSS files and see if the styling rules are applied for a specific page. It could be like .page-id-662 or .pageid-662
The last you could check is the functions.php file in case you enqueue a styling CSS file on specific pages as well.
What did you do exactly?
Created a new page in the Wordpress backend and copied the contents of "Retail?
Or put on a whole new Wordpress website and copy the "Retail" page there?
And please give an example of what went wrong in the design. Can you possibly specify the HTML code of an element with a design error?

Sitefinity cms related media link to document using custom field, not loading document path url

I am a beginner for sitefinity, so sorry for long post, not sure if its already answered, couldn't find out.
As working on sitefinity-8, looking for best option to select separate css while creating page each time.
I know, I can use different theme for different css, which will not work in my case, as we are having long list of css to use in whole site. Also I know, I can add css or any link into the head tag option of page properties or I can add css widget on the page itself to select css for that page only, but our requirement is to select css file while creating the page itself, this will make easy for novice editors too.
Basic thing I tried, to add css script tag into template, made it editable on page. So I can select css, but it exposes server folders, which is not ideal. Wish is there any way so that we can configure to select folder from sitefinity content- Documents & Files. But didn't find out a way to do so.
Other thing I tries, I have created custom field (related media-images, videos, files) for page to select a document & use as a link to add into head tag (to say link to add css for page.) With this custom field I can select needed document from appropriate folder from sitefinity backend itself, not from server. When I am looking into page source, I could see the link tag is there, but href attribute is empty. I also tried with adding related media tag into template the page is using, but the issue is same, no any value in href attribute.
Struggling to resolve this since long time, seeking for expert's advice.Thanks in advance.
The custom field path you've chosen should work - you will need a custom widget on the Page Template that will read the value of the custom field.
The GetRelatedItems extension method of the page node should give you the document object that was selected.
Having the document the widget will have to inject a link in the head of the page with the proper css attributes.

Request wordpress page and specify the page template

I have a website running Wordpress with a specific, custom theme and I would like to use some of the pages as an iframe within a different website.
The problem I am having is that I don't want to show the menu, header and footer, I want to use a different font and have the page load as quick as possible.
The best way to do this is to apply a different, bare page template to the page I want to embed as an iframe. However this will also affect the page when displayed on the website. There are plugins that will enable the content to be shown as json. This gets close to what I want to do but since it's an iframe I'd prefer to have some basic styling in there.
Is it possible to do the request for the iframe in a way a different page template is applied?
I've tried reading up about this but due to the sheer amount of articles explaining how the page template hierarchy works I've not been able to find anything explaining how to make the client influence this.
tl;dr can I do some sort of ?apply_template='page-bare.php' to enforce a different page template?
I think this might help you: Load post with a different template?
The way is:
Register new query variable
Redirect to a different template, when that query var is set
Create that template in the way you like it
get_template_part might also come in handy here.

How to create a slider with carousel/thumbnails in drupal 7?

I have got images in my content type and i want to show them in node type.
I've tried to use flexslider, but it doesn't format it.
http://i.stack.imgur.com/wUFk3.png
When i try to use field slideshow module, i had result like this
http://i.stack.imgur.com/P3CT5.png
So, i cannot choose carousel skin. Files path is /sites/all/libraries/jquery.jcarousel/skins
Guys, how i can make a slider with thumbnails in drupal?
You could try this module Views Slideshow JCarousel
You don't need drupal module for everything - a lot of stuff you can do on your own by using custom content types and 3rd party JS libraries:
Define content type, as you did, to hold data and make page editable.
Create new content type for page displaying effect.
Find some JS library (don't have to be drupal related) doing your effect
Create template file for your second content type
Copy HTML from that JS library example page inside your template file
Include necessary JS and CSS file - make it work static first.
Create some view to get effect data from your original content type
Use views_get_view_results() to get effect data inside your second content type. Loop trough it and print out data you get instead of static values
Or use views_embed_view() instead - makes no bid difference.
Check this out, it's what you're searching for https://www.drupal.org/project/galleria

drupal: adding simple links to a block

im using Views to output a block, containing latest post titles - simple and working. id now like to add some text links that should be different than the "more" link you can add through the Views UI. they are basically just p-tags with a-tags inside, pointing to a url of my choice.
right now i just inserted the markup in Basic Information > Footer > Full HTML.
is this the standard way of achieving what im after?
You can write custom templates for each row in a view if you want. Have a look at views 2 theming
Theming is a good way to do it but then it adds an additional responsibility to move the theme file when you move the view from one site to the other.
The header and footer are provided so that you can add html and php code to it, so it is definitely the right way to do it or else it would not have been provided in the first place by the module developer.
Also if the urls are related to the drupal site then I would suggest you to use php mode and add the link using l function (http://api.drupal.org/api/drupal/includes--common.inc/function/l/6)

Resources