show only the content of article - joomla

how do I only show content in a single article?
I am using Joomla 2.5 and Ajax to call a single article, but when I render the article in a <div> tag, I render again the header, the footer and all the page , but I only want the content.
How do I configure the page or the article to show only the content?

If you only want to get component you can append tmpl=component parameter with the url.
Your article url will be like this-
index.php?option=com_content&view=article&id=1&tmpl=component
Or you can try like this-
$('#result').load('index.php?option=com_content&view=article&id=1&tmpl=component #container');
Loading Page Fragments

Related

Changing page subtitle using the URI in Menus?

I have an application-menu item that I added that contains a URI with a custom filter in attached to the page name (aka URI Querystring). I would like to have the page subtitle change to represent this filtered data on the page.
Has anyone done any work like this or have an easy way to set the page subtitle using the application-menu items?
Here is what is getting called in the browser:
<h1 class="oro-subtitle" id="grid-title-contacts-grid2073">All Contacts</h1>
Here is what is in the URI (decoded)
/contact?grid[contacts-grid]=i=1&p=25&s[lastName]=-1&s[firstName]=-1&f[__duplicate]=0&f[contactType][type]=1&f[contactType][value][]=PCM&c=id0.firstName1.lastName1.birthday0.gender0.email1.phone1.fax0.skype0.twitter0.facebook0.linkedIn0.googlePlus0.source1.countryName1.regionLabel1.addressPostalCode1.addressCity0.addressStreet0.createdAt1.updatedAt1.pictureFilename0.ownerName0.assignedName0.reportsName0.timesContacted0.timesContactedIn0.timesContactedOut0.lastContactedDate0.lastContactedDateIn0.lastContactedDateOut0.daysSinceLastContact0.contactType1.dateOfBirth1.PCMStatusContact1.tags1&v=all&a=grid
You can save the grid view and give it a custom title.
Here is the documentation on how to do that: https://doc.oroinc.com/user/back-office/getting-started/navigation/record-tables/#create-saved-table-views-grid-views
Then copy the URL for the page and use it for the menu item. It should now redirect to the saved view with your title.

Page title showing up as site title on articles that do not have a menu item associated joomla 3.2

On all my Joomla pages I have the articles title as the h1 tag, so until now, Joomla has always displayed the title, i.e. what you see on the browser tab as the h1 tag. (There were one and the same thing).
However, this is not the case with all the pages that have no menu item linking to them, (they are linked to the rest of the site through another article). Here the name of my site is the page title.
How do I make the h1 tag the page title on these pages?
Try this,
This is happen due to those article pages meta options have title, Meta tag and keywords those are blank or not set yet. Then this case Joomla will read those info from your Global settings It may have your site name and Global description.
So the solution is set the Proper meta info for those articles from article manager.
If it is not practical then you can try it from article view or layout page Set meta data of Joomla page
Second Method is for setting the page title forcefully from scripts. It used for any components like here you have to check first method it will work for you..
Hope its Helps..
Problem solved! Here is how:
Make an override of com_content article and edit the default.php. Around lines 42/43 you should have the following code (the line number may not be exact as I have already taken out some code for a previous override):
<?php if ($params->get('show_title') || $params->get('show_author')) : ?>
Straight after that, add the following lines of code:
<?php $document=& JFactory::getDocument();
$document->setTitle( $this->item->title ); ?>

PyroCMS: How to include one page inside another

I have a site with an "About us" page which is divided into multiple sections.
About Us
+Overview
+The Company
+Our services
+Future plans
(etc)
I want to have a floated block on the right hand side of each of these pages which contains links to every other page.
Ideally, what I would like is to create a page titled AboutUsSidebar, and then be able to include this page in all of the about sections through some kind of tag, ie..
{include('Sidebar')}
Is there anything like this in PyroCMS? Or perhaps a better way to do it?
You should use view partials.
Create your sidebar with it's HTML and save it into addons/shared_addons/themes/yourtheme/views/partials/sidebar.html and then you can include it in your layouts as so:
{{ theme:partial name="sidebar" }}
It looks like page types are the way to go, I didn't see the page types button at the top of the page before.
In the end what I was able to achieve the desired result by using a page type.
I have a page type called "About" which contains the sidebar html, then I use pages on top of that page type for each of the sections.
Worked very nicely.

Target multi-page content in Joomla 3.0?

I managed to do this by using an override for the category blog (com_sontent/category/tmpl/blog.php). There I used the following to differentiate between paginated and not-paginated content and to hide/show code elements via CSS.
<div class="category-desc pages<?php echo $this->pagination->get('limitstart'); ?>">
I would like to apply the same method to my template's index.php, for example wrap the component output in a container with a CSS class name indicating if the content is broken up into several pages or not.
This would make it possible to hide side bars from a paginated blog main page, whereas they would show in single (unpaginated) articles linked to from this page.
Unfortunately, my knowledge of PHP barely exists.

JSP code to display a JFreeChart using Struts2

All,
I have been trying to use this guide to render a JFreeChart on a JSP page. Could someone help me out with the JSP code required to show this on a tabbed panel using the struts-dojo-tags.
Eventually I want to render a different graph on each tab and refresh them using AJAX.
At the moment I have configured everything as shown in the link.
Update:
Here is the code from the struts2 guide which I am using:
<sx:tabbedpanel id="tabContainer">
<sx:div label="Local Tab 1" >
Tab 1
</sx:div>
<sx:div label="Remote Tab 2" href="%{#url}">
Remote Tab 2
</sx:div>
</sx:tabbedpanel>
Where url refers to my action which returns the chart result. This returns a lot of symbols on the tab so clearly it can't show the returned png.
I can also view the chart if I insert <img src="http://localhost:8080/myApp/myaction"> so the action does work correctly.
Do I need to create another JSP page which the url can point to which simply contains an image which gets a chart from my action?
Thanks,
Alex
I would suggest that you start gradually in steps
Make sure that the chart is indeed created (already done)
Create a single HTML page with an img tag that points to the url (see if this works)
Create a single JSP page with an img tag (see if this works)
Create a Struts 2 JSP page with an img tag (see if this works)
Create a Struts 2 JSP page with an img tag in a tab (see if this works)
Create a Struts 2 JSP page with an img tag in a tab that updates dymanically with Ajax
This way you can isolate the problem instead of throwing everything in the mix at once.
But in general you do NOT need another JSP page that contains the image.

Resources