Cannot view joomla component - joomla

I've created a joomla component which consists of a html form, and when I try and browse to it:
index.php?option=com_helloworld
I get an error 404, component cannot be found.
I'm following this tutuorial:
http://docs.joomla.org/Developing_a_Model-View-Controller_Component/2.5/Developing_a_Basic_Component
Can anyone please tell me how I can browse to the page?
UPDATE: here is the link to my sample component, its a basic html form.
http://tinyurl.com/d6tj7rz
Many thanks

IIRC, even if a component is not installed correctly, you can still access the code if it's on the server, from my experience. But that may have been a 1.5 thing.
If you don't specify a view in the URL by passing &view=viewname, AND you haven't set a default fallback view, then you can't expect to have anything come up.
For a good example on how to set a default view, look in components/com_contact/controller.php line 38.
Within the main controller's display method:
// Set the default view name and format from the Request.
$vName = $this->input->get('view', 'categories');
$this->input->set('view', $vName);

Related

Facebook feed dialog deprecating custom fields

Facebook Feed Dialog 2.9 has deprecated the custom fields (name, caption, picture, description) - https://developers.facebook.com/docs/sharing/reference/feed-dialog.
I'm working on an AJAX site where all content and metadata is loaded dynamically. If I just use the link property, the metadata isn't set on initial retrieval of the page so the post doesn't contain the right content.
How can I share an AJAX page on Facebook without having to go down the route of prerendering static pages server side? Thanks
If you can program your page to populate the appropriate metatags on the page load based off of a variable http:/yoursite.com/yourpage.php?thisversion=1 then when you want to share version 1 of the page, you just share the URL with the appropriate variable to populate it. You can still remain on your current version of the page but when you share the URL that would prompt that specific version, facebook makes a call to that respective URL and pulls the appropriate metatags that would be populated by your variable without having to reload the page your are currently displaying. Sorry I don't have time at the moment but will try and comeback and add some sample code for clarity.

CKEditor integration with laravel-filemanager

I'm using CKEditor and laravel-filemanager, which is a nice package written for Laravel. Anyway, I'm having trouble passing the URL of the selected image from the filemanager browser to the URL field in the plugin dialog in CKEditor. I did everything included in the README file of the laravel-filemanager, but I had no luck.
This link says I should use predefined route for 'filebrowserBrowseUrl=' in the CKEditor and the rest of the params in the query string is auto-generated like:
'myRoute/?type=Images&CKEditor=editor1&CKEditorFuncNum=1&langCode=en'.
My problem is that there is no 'CKEditorFuncNum' param in the url. When I click the 'Browse Server' button, pop-up window is opened with url: 'myRoute', with the query string params missing. Anyone familiar with CKEditor and laravel-filemanager knows what's going on when the pop-up window is opened. The 'CKEditorFuncNum' param is retreived by regex and then the function gets executed and the URL is passed to the editor dialog.
Since no URL is set in my case, clearly I'm missing something. If anyone knows something more, please share it with me, 'cause this is very annoying.
Thanks in advance

Joomla module or component to be render on a blank page

I have developed a Joomla module that does provides a form, processes its post data, does some calculations and displays the results.
The module includes a button to print the results. I'm currently using JavaScript to open a new window, paste the relevant HTML and open the print dialog.
Instead of JavaScript I would prefer to provide a separate URL for the print view and simply open that in a _blank target. This would make the application work better for people using screen readers or not having JavaScript available.
Is there any way that I can tell Joomla to not render the template along with my module? I was thinking that creating a component fixes that issue, but had to find that components are rendered into the template, too...
BTW: I have Joomla 1.5.22
To achieve what you want you have to add additional tmpl=component query string parameter to the request URL. This will disable template and module rendering.
Your URL will look something like this: index.php?option=com_xxx&view=xxx&tmpl=component
Since you are using Joomla 1.5 you can request index2.php?option=com_xxx&view=xxx and it will only render the component. Joomla 2.5 does not have index2.php so if you plan to migrate in future, don't use this option.
If you are using SEF then adding ?tmpl=component at the end on URL does the trick.
To go a step deeper... in your template directory you have component.php file, that is the file that's being loaded by tmpl param. You can copy component.php to my_component.php, do necessary changes and load your custom component template with index.php?option=com_xxx&view=xxx&tmpl=my_component
The joomla way of doing it would be to set your output to "raw", see this tut:
http://www.katcode.com/displaying-raw-output-in-joomla-by-setting-format-in-the-component/

Alfresco share page state history

How can I manage page state history in share (surf?) so that I remember for example which yui tab was active and on which page the pager was on?
I noticed that alfresco share does something like that after form submit. You get redirected to the exact same page url where you were before. If any "ajax state" (don't know what they are called) parameters are in url like #something=asdf you get the same url.
But when using manual navigation like moving through site pages those parameters aren't saved.
Is this even a good idea to do? To save page state in session for example?
Some pages have support for URL parameters that are passed in. In those cases the browser history is used, e.g. we editing metadata in the full page meta data view the user is send back to the page he is coming from. This is done in javascript by calling window.history.go(-1) after form submit but only works when parameters are set/retrieved by URL. The document library implements page specific javascript for setting the URL and parsing parameters from it.
I some places Alfresco uses the preference service to store user settings between different pages permanently. For example this is used in the document library for the "show folders" and "simple/thumbnail view" buttons. Here is some sample code from the document library javascript setting a preference option:
var PREFERENCES_DOCLIST = "org.alfresco.share.documentList",
PREF_SHOW_FOLDERS = PREFERENCES_DOCLIST + ".showFolders";
var preferences = new Alfresco.service.Preferences();
this.services.preferences.set(PREF_SHOW_FOLDERS, true);
The evaluation of the properties is usually done in the Share component webscripts, you can have a look in share\WEB-INF\classes\alfresco\site-webscripts\org\alfresco\components\documentlibrary\include\documentlist.lib.js for an example.
In any case you have to dig into Alfresco's javascript code in the browser and the share tier to see how to implement it.
You could check parameters sended to the server side after form submiting in the firebug (firefox plugin) and then you could use the same parameters.
Also perhaps you should use yui history manager:

MVC3 - What's with the caching of razor views?

What is the official line on how to make sure a razor view is rendered as latest? At the moment it appears I am getting a cached version.
I have a view, that renders a partial and this partial renders a template.
Save, compile, iis reset:
Same old view!
Stop it now!
Let me give u an example
#Html.EditorForModel("~/Views/Shared/EditorTemplates/Object.ascx")
Renders Object.ascx
Remove that line renders nothing (good)
Then adding
#Html.EditorForModel("~/Views/Shared/EditorTemplates/Huh.cshtml")
Renders Object.ascx
=Insanity.
Did you try Ctrl+F5 in your browser? Maybe the html was cached on the client. Also if you are using the [OutputCache] attribute to cache it downstream this could happen.
UPDATE:
After you have posted your code you seem to have overriden the ~/Views/Shared/EditorTemplates/Object.ascx default template. Then you replace this line by:
#Html.EditorForModel("~/Views/Shared/EditorTemplates/Huh.cshtml")
but depending on the model used in Huh.cshtml Object.ascx could still be rendered for some properties.
Found it: it has to be called Object.cshtml and no other control called "Object" can live in that folder (e.g. Object.ascx).

Resources