Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I have a Drupal 7 multi-language(3) website. I have installed the Internationalization (7.x-1.0-beta2) module.
I have created for each language a page, and translate it into two others languages.
Now here is what I want to do: to set a kind of intelligent "front-page" to know what language is selected and set the front page (which I choose) in that language.
How can I do this? I know that in Internationalization module, there is no such kind of thing, am I right? If I set the front page to nothing I get this message: “No front page content has been created yet.” which is normal because Drupal is asking me for one front-page to be set, however I want to have for each language a front-page.
Might be late to the party with this answer, but after many hours spent trying to solve this myself, I've the following solution.
For Drupal 7:
1- Make sure you have the modules Variable and Variable Translations switched on.
2- Goto admin/config/regional/i18n/variable
3- Select the 'Site information' list tab and check 'Default front page', save settings.
4- Goto admin/config/system/site-information, you'll notice a block of text there saying something about some of your settings being multilingual variables and a list of links for the languages you are running which allow you to set the settings for each language.
Now, this is where the real GOTCHA comes up... clicking those links and changing the settings does nothing. Your left with the same settings still for all languages. The way around this?
Check the URL you are currently on, the entire thing, so something like: http://www.example.com/en/admin/config/system/site-information/
Notice the language prefix there before /admin?? To change the settings for the other languages you want to use, switch the prefix in the URL and then make your changes. And now, as if by magic, multiple front pages, properly changing based on language.
This must be a bug in Drupal, I should get around to opening a ticket. But for now, if someone else comes across this, I hope it solves your problem too.
I've been searching for the same. I 'd like to recommend Drupal 7 - multi-lingual front page node which is complete and works perfectly for Drupal 7 projects.
After continuing to rip my hair out over this, I found out that this feature is incompatible with anonymous page caching!
Go to /admin/config/development/performance and turn off page caching for anonymous users.
May be there is a better way but finally he is how I did.
I have added in template.php the following code:
/**
* Implements hook_preprocess_page().
*/
function aelius_preprocess_page(&$vars) {
if ($vars['is_front']) {
$langcode = $GLOBALS['language']->language;
if ($langcode == "en") {
drupal_goto('home');
} elseif ($langcode == "fr") {
drupal_goto('accueil');
}
}
}
I haven't worked with Drupal 7 i18n yet, but in Drupal 6 you would add a site_frontpage variable to $conf['i18n_variables'] in settings.php and then switch to each language in turn and set the frontpage on the site information page.
Alternatively, you can specify a condition in your theme front-page.tpl.php like so
Related
I am using Drupal 7.
I am using Drupal's Quiz module version 7.x-5.2 and only an Admin can see each "Question's feedback" in the quiz results view/page.
Everything else works perfectly:
In the quiz results view/page, I can see:
The question
The option/answer that the user chose
The grade for each question
But only an admin can see each Question's feedback in the results.
I am also using Content Access version 7.x-1.2-beta2 and in the ROLE BASED ACCESS CONTROL SETTINGS, everything seems to be set properly.
I "played" a bit with the grade, summary, Feedback table and I manage to move each one of them in the Quiz results display and I also manage to remove each one of them out of the Quiz results display and then bring it back.
Every such configuration change that I make is visible to all roles, but the only "stubborn one" is the Question's feedback. - Only an Admin can view it.
One more thing:
When I enable all users to be able to "Edit any quiz content", then all users can see the question's feedback (for every question) , but this is obviously not what want. I cannot allow all users to edit any content...
Just to be on the safe side, what I really want in this case is to provide the following:
After a regular user finished answering a whole test/quiz, I want him/her to view:
all the questions in a list/table (this works well)
For each question, I want them to see their score, e.g.: 0 of 1 or 1 of 1 (this works well).
For each question, I want them to see their answer (this works well).
For each question, I want them to see the right answer (this works only for admin users or for users who have "Edit any quiz content" enabled).
For each question, I want them to see the question's feedback, where I wrote an explanation of how to solve the question. (this works only for admin users or for users who have "Edit any quiz content" enabled).
How do I enable all users to see the question's feedback ?
I am not sure it's related, but in QuizResultAnswerController.class.inc of Quiz module version 7.x-5.2 I saw the following:
if ($instance->canReview('question_feedback')) {
I think (but not sure...) that this piece of code "decides" not to display the question_feedback for regular users.
I don't understand why does this feature require someone who can review and/or how do I enable someone to be a viewer/reviewer of the results without enabling him/her to change the content.
Please help me. This is very important !
Thanks a lot !
I found the answer.
Click here to view it on Drupal's site.
I am building site in Drupal and I need your help. I have an assignment to make one more language translation of the site, and so far so good. However, I have one trouble with one block which isn't going to get translated, even though in the settings I translated it.
Also one strange activity I noticed is that when I try to go to VIEW section of all the other languages, I get dropped to front page (where that block is actually located) but if I press VIEW from my language translation (Swedish) of the block I get to completely new page.
If I go to front page and my language is selected, that block is actually using default language.
Any help what may cause it?
For desire url aliasing you need to install pathauto drupal module. then you can configure alise from below url
admin/config/search/path/patterns
OK, I have found a solution to this problem.
It appears that Drupal 7 by default sets your new language homepage to the default homepage and that's why this block was using default language since it was relying on the front page. Anyway, to fix the issue follow the steps:
Login to adming account, go to Configuration, System, Site Information and in the field Default front page for the language you have chosen navigate to your specific node page. That's it.
I am testing out DNN 8 and am using the blog app and content management from 2sxc (great module, BTW!).
I have the recent blog post listed on a page sub-directory called '/articles'. But I also wanted some of them listed on the home page as well. When I add the app or module to the home page the url is '/home/post/post-title-here' while on the /articles page the urls are '/articles/post/post-title-here'. This creates the illusion that I have two directories with duplicate blog posts (which probably will get me some dings for SEO for duplicating the same content).
How do I get the app to use the common directory '/articles' regardless of where I put the module/app on the site? I've looked at settings all over and don't see anything that pops out at me. Also not sure if this is a DNN setting or a setting specifically to the extension. Finally, I'd like to be able to keep the year/date/month parts of my url as well as they were on the old site. I assume making that change would probably be similar with the solution to my original question. If that's a different fix, then let me know and I'll put it into a new thread. Thanks in advance!
This question is basically about the blog-app. Now if I understand you correctly, your question is "Can I have multiple lists on various pages, but all of them still link to my main details page". The answer is yes, but the exact solution depends a bit on what you need.
So basically there is a setting in the app-settings to define the main page. I believe it's empty by default, so that the blog-app works automatically without you having to configure anything. But AFAIK if you set that, all blog-details-links will use that as the only source.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I was going through a site and saw that site is developed in wordpress. However, when i land on below page. I am unable to understand whether they have used a wordpress plugin or api to develop functionality:
https://legaldesk.com/affidavits/affidavit-for-change-of-name
Above link shows me a form when I select any city and click on create agreement. It asks for my details and on the right it shows preview.
Please answer . If this question should not be asked here, please do let me know the right site on which I can ask this. I like learning new technologies.
The forms themselves seem to be from "TemplatesForm" sourceforge.net/projects/kobject/files/kobject-java/tests/tests/…
Generally, the process of finding which plugins and scripts is one of a kind of forensic detection using, on the one hand, direct links to scripts' sources, which lead to the publisher's url and on the other, class names and other names or function calls, for example, found in the HTML.
Apart from obvious signs like "Powered by WordPress" or similar lines which some sites will have clearly displayed on them, you can find out a lot from the HTML page source.
Right click your page, select "view source" and search for, for example, "plugins" in the paths you find. One plugin used here is http://codecanyon.net/item/mega-main-menu-wordpress-menu-plugin/6135125 MegaMainMenu also Woocommerce, LayerSlider http://codecanyon.net/item/layerslider-responsive-wordpress-slider-plugin-/1362246 and FlexSlider https://www.woothemes.com/flexslider/
In this case, this is the theme - http://themeforest.net/item/envor-fully-multipurpose-wordpress-theme/9251688
They are also using Visual composer WYSIWIG plugin to help build it. codecanyon.net/item/visual-composer-page-builder-for-wordpress/…
You can launch scripts in browser windows as text by clicking on links to them in the HTML itself (at your own risk but it usually pops up in the browser as text) and you will often find the licence agreement texts at the top of the script.
You can see what national language the script has traces of to establish nationality (for example the forms scripts have traces of French in their variable names, which match with those on this site) This will help to confirm if you have discovered a script which was produced in the country you expect.
You can also see what programming language is involved, to help in your search and understanding of how the site works.
Website traffic in this case is monitored by Data Sumo Me https://sumome.com/ and Google Analytics. Also the Yoast WordPress SEO plugin is used. The URLs and names here are fairly obvious in the page's HTML and in HTML comments.
The part that pops up the overlays wordpress.stackexchange.com/questions/95661/… myModalLabel is BootStrap Modal - More on Modal Popups from http://www.tutorialspoint.com/bootstrap/bootstrap_modal_plugin.htm which seemed a very clear tutorial and explained the application of modal popups well.
More on Modal dialogue boxes - there is plenty you can do with those and they have been used extensively on this site en-gb.wordpress.org/plugins/modal-dialog modal-dialog for popup dialog boxes - you may find other bits on this site, including the usual jquery, bootstrap and fonts/css.
Another script called "imageareaselect odyniec.net/projects/imgareaselect is used for selecting image areas.
As this question is a little "off topic" for Stack Overflow you should probably try on Wordpress StackExchange, wordpress.stackexchange.com though they don't actually recommend any specific plugins as a matter of policy. I am also not recommending any here, only answering your question as to what has been used here and hope that the focus on what actually makes it work will be of use and interest to programmers who read this answer.
I can't see any other ones indicated in your webpage example - there may be some I have not noticed, but this answer is also intended partly as an example of the forensic analysis processes involved in working out what powers a site, which is at least partly within the scope of StackOverflow and I hope you will be able to use it to help you complete the discovery of any I missed. This started out as a collection of comments but seemed to develop a life of its own.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I'm trying to redirect users after commenting on my Wordpress blog, can anyone steer me into the right direct? I just want it to redirect them once.
There are a few ways that you can do this. The first and simplest is just to write a little function for yourself to do it. You could put this into your functions.php file, in whatever theme you are using.
add_action('comment_post_redirect', 'your_redirect_function');
// A function that redirects your users after they have commented.
function your_redirect_function ($location, $comment) {
// Here all you need to do is return the url of your target page.
$page = 'http://www.stackoverflow.com';
return $page;
}
Sometimes it's better to use Wordpress plugins rather than adding functions to your theme's functions.php file, because if your theme has an update then you'll lose your function! There are some plugins available to do this - the most popular one is Yoast's (he has a plugin for everything doesn't he?) You can download it at http://wordpress.org/plugins/comment-redirect/
I've found Yoast's plugin to be a little limited though, because the redirect will only work once for each of your users. This is a good and bad thing - say you want to thank your user for a comment, then you can only do it once. But it's good if you're asking them to sign up to a service, say. The other popular comment redirect plugin that has more features (but it's not free unfortunately) is Comment Redirect.
Again, it's probably better to go for a plugin, because it will have more features - like limiting the number of times each user gets redirected - and it will also survive the updates to your theme.
Use the below filter hook
comment_post_redirect
For more details
http://codex.wordpress.org/Plugin_API/Filter_Reference
More samples below:
http://wordpress.org/support/topic/a-simple-redirect-using-comment_post_redirect-in-functionsphp
http://wordpress.org/support/topic/redirect-after-posting-a-comment