I am using tstranslate-widget for a multi language website from here.
By far it is a very good extension, but I am having trouble showing the categories like (site/category,site/login etc) of the web when clicking translate. What else am I supposed to do except those mentioned in the documentation?
just add
<?php echo Yii::t(null, '<p>Congratulations! You have successfully created your Yii application.</p>');?>
to the index.php and I think it will show (site / index)
Related
I want domain.com/custompage, but the built in functionality puts all pages inside a /pages/ directory so the URL comes out domain.com/pages/custompage which I don't want.
I found this answer from a Shopify Guru in 2016 that mentions potentially setting up a custom HTML template or using an app, which no longer exists.
Any clues on how to achieve this? I have limited experience with Shopify templates, but could figure it out if someone could point me in the right direction.
This blogger says it can't be done:
"Q: Can you create pages on the root? A: The answer to this is no –> all pages have either /pages/, /collections/ or /products/ in the URL."
However others have told me it is possible. Just not how to do it.
Create a section Name "test" // first a step
Create a page json Name "test" // The second step
After creating the page, JSON does a section test
Title says it all. I want to create a custom prestashop page, but I don't know how.
What I actually want to do: create a button that opens a custom page. I can't find anything useful in the internet so I came here to ask for help. Could someone explain me how to do that?
There are many ways to add a new page, it depending in your needs.
By a CMS page, you can add the content you need in the HTML editor, like the product description: http://doc.prestashop.com/display/PS16/CMS+-+Managing+Static+Content
By a front controller from a module: https://devdocs.prestashop.com/1.7/modules/concepts/controllers/front-controllers/
By creating a new page, here my explanation: Prestashop custom page with own template
The point 1 is the most easy way for a common user, the rest of the points require advanced knowledge.
i am using a third party plugin with yii, it provides chat functionality, it has its own DB and php files that provide the functionality,
now i am want to use it in the view, but the simple include statements are not working, do i need to convert it to yii or can i use it as is?
<?php
session_start();
// Load MySQL DB settings
include_once('config.inc.php');
$_SESSION['username'] = 'Currently logged in users's username from database';
$_SESSION['user_id'] = 'Currently logged in user's id';
?>
//That's it! To print online users, you need to do it like this:
<?php
$users = mysql_query("SELECT id,username FROM ".$sql_table_users." WHERE chat_status='online' AND id!='".$_SESSION['user_id']."'");
if(mysql_num_rows($users) > 0){
while($user = mysql_fetch_assoc($users)){
print ''.$user['username'].'<br />';
}
}
?>
this is the interface plugin has provided for me.
plugin location is /assets/plugin.
i cant use direct php query commands to another Database, which i want to keep seperate from mine, plus the js file that comes with the plugin calls the script with wrong URL parameters, so what is the best method to incorperate this into my yii app. thanks
You should create a Yii extension that'll wrap your plugin.
Then in your view you'll have to call a widget that'll display your chat.
I think this is the best way to do it because using this all your call to the plugin will be performed with the yii strucutre and philosophy. Only your extension will be structured using the chat philosophy.
Source about creating widgets
I created an article on joomla and I'd like to display a part for all(public) and another part of article only for registered users. Now I create a module that I integrated on article page, but I'd like to display the login.
Alternatively I can create 2 page: a login page that redirect to the my registered article. How can I do this?
Thanks
Or just use the built in show unauthorized feature that shows the intro but not the body to users who do not have authorization to see the article. YOu can set this globally or article by article or with a menu link.
For the login module, what you can do is, define a custom position for it by typing one in, rather than selecting one of the predefined ones, then embed it by using the following code:
{loadposition xxx} //xxx being the position you defined
Or, you can use an extensions from the Content Restriction category on JED to restrict content.
Personally, I think Hider might be your best choice, as it allows you to defines specific groups and specific content.
Alternatively, you can do it this way. Firstly, download and install Sourcerer which allows you to use any code in your articles. Then use the following code inside your article and be sure to use the {source} tags:
{source}
$user = JFactory::getUser();
if ($user->guest) {
echo "some content";
echo "Login to read more";
echo "{loadposition xxx}";
}
else {
echo "all content";
}
{/source}
I have a component with several categories of games and I want to display a different banner depending on the category. I need the banner (and link) to be customizable so it's not simply a case of showing categoryX.jpg or whatever.
I saw this Joomla help page on another question, but it only seems to display a module type, not one specific module. I'd like to use various mod_custom modules and display the one appropriate to the category (I can store each module's ID if necessary).
Any ideas?
This can be done in a 2 step process:
Use the "Load module into article" plugin to allow yourself to access the module using a plugin call like:
{module [*mod_id*]} // where *mod_id* is the module id
Now that you can call a plugin to put your module anywhere, you now need to go to the view code of your/a component you wish to add the module to and add this code:
echo JHTML::_('content.prepare', '{module [*mod_id*]}');
Please see this link - http://www.alltogetherasawhole.org/group/developers/forum/topics/running-joomla-content-plugins - regarding point number 2. I was trying to do the same thing and I found it didn't work, and the reason for this was a comment you can find on the page link above:
"I noticed that some plugin actually expect option=com_content for them to process onPrepareContent properly, so you might actually want to "fool" them by callin JRequet::setVar and restoring the correct values after the trigger."
If you would like to show module within PHP code then use this code, it's worked for me :
<?php echo JHTML::_('content.prepare', '{loadposition position-2}'); ?>
If you want to show module inside html content then just put this code where you want to show module.
{loadposition position-2}
It loads all modules which are assigned to position-2.
You can also use the Joomla Module Renderer
$doc = JFactory::getDocument();
$renderer = $doc->loadRenderer('modules');
$position = 'custom_position_name';
$options = array('style' => 'raw');
echo $renderer->render($position, $options, null);
Just a heads up, Along with being assigned the module position, that module also has to be set to "Display on All pages".
Joomla has this functionality built in. You can use the {loadposition XX} command within your content items. You can specify custom module positions that do not appear in your template to insure that you have the correct module in the correct article.
http://docs.joomla.org/How_do_you_put_a_module_inside_an_article%3F
You could create a new module?
If each category appears in the querystring (catid=X) then you could take a similar approach to https://support.pillwax.com/open-source/doku.php?id=joomla:header_image.
Alternatively, that link might actually do it for you.