I use symfony 1.4 with Doctrine. How to make printable version of page in symfony?
I have module "company" and I want to make printable version of show action.
Is it possible to open information about my company in new window without sidebar, footer...content which I need to print?
// company/config/view.yml
showSuccess:
has_layout: false
'The view.yml configuration file defines the default layout used by the application. By default, the name is layout, and so symfony decorates every page with the layout.php file, found in the application templates/ directory. You can also disable the decoration process altogether by setting the ~has_layout~ entry to false' (c. The view.yml Configuration File ).
Related
I am busy making a sublime text plugin/package that will ease development of lua scripts in my workplace.
We have several lua files with different extensions depending on their purpose. I want ST3 to give the proper lua syntax to these files.
I know you can set ST3 to remember syntax for a specific file extension and this is saved as a (in my case) Lua.sublime-settings file in AppData\Roaming\Sublime Text 3\Packages\User
However, if I put this file in my new plugin's folder, it's ignored.
Am I doing something wrong or is what I want not possible?
This doesn't work because syntax specific settings are only loaded from the package that defines the syntax and from the User package (so the user can customize them).
The following is a quote from the official documentation on settings:
Settings files are consulted in this order:
1. Packages/Default/Preferences.sublime-settings
2. Packages/Default/Preferences (<platform>).sublime-settings
3. Packages/User/Preferences.sublime-settings
4. <Project Settings>
5. Packages/<syntax>/<syntax>.sublime-settings
6. Packages/User/<syntax>.sublime-settings
7. <Buffer Specific Settings>
The only places where <syntax> is referenced is from the package itself and from the user package.
If I had to guess, I would say that this is because outside of the original package author that defined the syntax, all other settings would be considered user customizations, and those settings need to be in the User package (specifically in the root of it) to ensure that they're loaded last.
A simple (but undesirable) solution would be to document for the user that they have to take this step manually.
Another approach would be to add some plugin code that extends the settings when your plugin is loaded:
def plugin_loaded():
settings = sublime.load_settings("Lua.sublime-settings")
extensions = settings.get("extensions", [])
if "blarb" not in extensions:
extensions.append("blarb")
settings.set("extensions", extensions)
sublime.save_settings("Lua.sublime-settings")
If you go this route you may want to include an extra sentinel setting somewhere (in settings specific to your package or some such) that says if you did this or not instead of just forcing the setting in as the example above does.
In practice you would then check if you've set that sentinel or not instead of forcing the extension in, so that if the user decides to use some other syntax for your files you're not forcing them into the Lua syntax.
It's also possible to define your own syntax that just embeds the standard Lua syntax, which allows this to Just Work⢠without having to write any code or have the user do anything:
%YAML 1.2
---
name: Blarb
scope: source.lua
file_extensions:
- blarb
contexts:
main:
- include: scope:source.lua
When you do this, the scope in the file will still be source.lua because that's what the scope in the syntax file says. and the status line will set the syntax name to Blarb. You could modify either of those to change the top level scope or displayed name, if desired.
An example would be to change the scope to source.blarb so that you could create key bindings/snippets that only apply to Lua files of your specific variant.
A potential downside/feature of this is that since the name of the syntax specific settings comes from the name of the file that provides the syntax, if the user has any Lua specific settings, they won't apply to your Blarb files by default.
Similarly anything that's specific to Lua by checking for a scope of source.lua won't work in Blarb files for same reasons, which may or may not be an issue.
I install Orchard CMS 1.10 and take russian translate from https://crowdin.com/project/orchard-cms and unpack to Orchard.Web. When i added and enabled ru-Ru localization all work good for razor views. But for module isn't. For example i try change validate message for required fields in Orchard.DynamicForms, but nothing happened when displayed validation message, they still english. Also translate not applied for module list in admin panel.
Search for the english message in source code, add breakpoint and step into the T() call, then check the value of the scope parameter. This is the value that should be used in the msgctext line.
I have an includes file with this content - #show = :dev I need to include this file in my layout so I can use this variable everywhere. I've tried including it:
.content
= render "includes/dev_live"
but it only works if I reference it in every view rather than just once in the layout. I can't just type in the variable as my site is hosted on two servers each with different variables.
Try the rails_config gem, it allows you to create settings files that are available in all controllers/views. For example have a settings file that reads:
:show
'live'
then in your controllers/views you can access this by writing
Settings.show
(optionally converting to a symbol using to_sym if necessary)
By default the rails config gem has a local settings file which is not tracked by version control (for git anyway), so you can have different versions on different instances.
`I've installed the DateTime Field module to Orchard and assigned two fields to my custom part, but when navigating to the Admin Edit page for the custom type implimenting the custom part, I recieve an error like this:
A 'stylesheet' named 'jQueryUtils_TimePicker' could not be found.
When looking in the Contrib.DateTime.cshtml View, I find that the following two resources are required, but I can't find them in the jQuery module's resource manifest.
Style: jQueryUtils_TimePicker
Script: jQueryUtils_TimePicker
Where are these meant to be defined and stored?
Thanks in advance.
P.S.
If I change both to jQueryUI_TimePicker (for which there is a script and style defined in the jquery module resource manifest), then it doesn't throws an error, but the time picker doesn't work.
Contrib.DateTimeField is obsolete since 1.4 so you shouldn't use it.
The DateTimeField has been integrated in Orchard.Fields has a core feature.
I want to build a multi page website and I need a way to refer to another GWT page (panel) how can I do it such that the links are static?
There are three issues in your questions:
how to specify the url of a gwt page.
how to ensure that url is static.
how to create a link to that gwt page from another gwt page.
A GWT url is effected by the module name and package namespace and can be modified by the rename-to attribute. Say, the GWT module description file is named whatever.gwt.xml; and whatever module is placed at package namespace zoom.wonderful.world . The url of the module would be http ://hostnamespace:port/zoom.wonderful.world.whatever. But you can use the rename-to attribute to change it , the url would be http ://hostnamespace:port/holycow.
But ... your module is not accessible by url unless you have an entrypoint - i.e. a gwt java file that implements EntryPoint.
You can have more than one entry point in a module, but under most circumstances my opinion says that you should not unless you wish to begin a career into the most confusgated GWT code contest. The ui representations of all the entry points in a module would overlap. A similar confusgating overlap effect is available if you inherit an entry point.
Behind my mind, I keep asking why you deliberately ask "static url", because the url of the entry point of a module is indeed static.
Then in your other "gwt page", you merely include list the "static urls" of all the "gwt pages" either
- in the hosting html file (which launches the module javascript-compiled files)
- or, within a gwt widget that allows url links or html code to be included.
http://h2g2java.blessedgeek.com/2011/02/uibinder-check-list.html