get the frontend theme path in magento admin - magento

In my Magento module i upload a CSS file in the backend to use it in my front
I tried this :
Mage::getSingleton('core/design_package')->getSkinBaseDir()
But it gives different path (admin/front)
In my Block , I got this :
C:\wamp\www\ce_1.6.2.0\skin\frontend\default\default\
And in my Adminhtml/Controller (saving the file) I got this :
C:\wamp\www\ce_1.6.2.0\skin\adminhtml\default\default
How can I get the same path (front) in the Block and in the Controller ?
Thanks

just force it to the frontend :
Mage::getSingleton('core/design_package')->getSkinBaseDir(array('_area' => 'frontend'))

I'd like to offer and alternative to Rastaking's answer that will return a URL path rather than a file path:
Mage::getModel('core/design_package')->getSkinUrl();
This will return something like:
http://www.yourdomain.com/skin/frontend/your_package/your_skin/
Hope this helps, anyone looking for a similar solution.

You can try this:
Mage::getSingleton('core/design_package')->getSkinBaseDir(array('_area' => 'frontend','_package'=>'rwd','_theme'=>'default'));

Related

I got error No hint path defined for error with diglactic breadcrumbs plugin?

In laravel 8, tailwindcss 2.1 app I want to add https://github.com/diglactic/laravel-breadcrumbs
so on install I modified config/breadcrumbs.php with :
'view' => 'partials.breadcrumbs::tailwind',
and as I want to modify defalt colors reading doc I created
resources/views/partials/breadcrumbs.blade.php file with content from the description
I filled file routes/breadcrumbs.php with breadcrumbs definitions I need.
But I got error :
No hint path defined for [/partials.breadcrumbs].
(View: /MyProject/resources/views/admin/dashboard/index.blade.php)
Looks like some path is invalid, but I do not see what I missed ?
I cleared cache, but it did not not help!
Thanks !
Looks like if I want to use and edit partial file /MyProject/resources/views/admin/dashboard/index.blade.php, I have not to set tailwind in 'View' parameter , just :
'view' => 'partials.breadcrumbs',

How to activate randomized filenames in powermail

i have a form where user could upload files. There are 3 files they could upload and each of them need to have an unique name. So even the person upload the same file everytime i neet different names for it in the email, i get from the form.
So i try to use randomizeFileName.
https://github.com/einpraegsam/powermail/blob/develop/Configuration/TypoScript/Main/setup.txt#L538
Cause i dont have the randomizeFilename in my constants.txt it try to enter it in my setup.txt with a real value.
# File upload settings
file {
folder = {$plugin.tx_powermail.settings.misc.uploadFolder}
size = {$plugin.tx_powermail.settings.misc.uploadSize}
extension = {$plugin.tx_powermail.settings.misc.uploadFileExtensions}
randomizeFileName = 1
}
But sadly that dont work. The file issues-1.pdf still has the same name (+ a suffix cause i tried it a lot time )
I hope someone can help me. Thank you very much!
Based on the setup file included in the extension, the correct syntax for Powermail 7.x would be:
plugin.tx_powermail.settings.misc.randomizeFileName = 1
randomizeFileName = 1 is the default value in Powermail 7.x!
You have to set this over Typoscript Constant, not in Typoscript Setup:
In Typoscript Setup this may work. (Not Tested)
plugin.tx_powermail.settings.Pi2.misc.file.randomizeFileName = 1
Read the source code to see more:
https://github.com/einpraegsam/powermail/blob/develop/Configuration/TypoScript/Powermail_Frontend/setup.txt
Or the documentation: https://docs.typo3.org/typo3cms/extensions/powermail/stable/ForAdministrators/BestPractice/MainTypoScript/Index.html

facing some issue related to codeigniter url routing

I just want to show the url websitename/common_controller/about as websitename/about
I did like this in the config/routes.php
$route['about'] = "common_controller/about";
But it is not working. please help me.
Try writing
$route['common_controller/about'] = 'about';
if you method takes input you can write
$route['page/(:any)'] = 'method_name/$1';

CodeIgniter parser addon

Can't load my_parser class.
Added this http://codepad.org/QtHsyRN3 to application/libraries
than in controller i wrote
$this->load->library('my_parser');
but i am getting
Unable to load the requested class: my_parser
What can be? I need something like this
{if 10 > 8}10 is greater then 8<br />{/if}
But without smarty and etc.
The user guide states you shouldn't include the 'MY_' when calling the library, so:
$this->load->library('parser');
should work - see http://codeigniter.com/user_guide/general/creating_libraries.html
.php file was wrong name. Solutions is "class name = .php file name"

MVC3 - Getting the actual page path rather than Route

I have a route as
http://www.domain.com/Test/12345678
This points to
http://www.domian.com/SomeArea/SomeController/SomeAction?customerId=12345678
Request.RawUrl gives the path as http://www.domain.com/Test/12345678
Request.Url.AbsolutePath gives the path as /Test/12345678
Request.Url.LocalPath gives the path as /Test/12345678
Request.Url.AbsoluteUri gives the path as http://www.domain.com/Test/12345678
So, how do i get the actual page path that is currently displaying as:
/SomeArea/SomeController/SomeAction
I think you want Url.RouteUrl
I think Request.FilePath is what you are looking for.
If you want the PathInfo trailer you can use Request.Path

Resources