dongshi1188 2013-10-16 18:54
浏览 33
已采纳

在Drupal Cache之外创建动态菜单链接

For our Drupal 7 Commerce site we are trying to create a "portal system". I have it set up with all of the content at this point with all of the content referencing the same taxonomy to filter the respective products and content into either "portal one", "portal two", or both in the same. I have also already set up all the views and content types to display the content appropriately. Everything is 100% but now I need to use either session data or cookies to let the user (anonymous and authenticated) to choose from a pop up with "portal one" and "portal two" (this is already created as well) and change the urls on the main menu accordingly.

Currently the site is set up to have testsite.com/portal1/products as the url for portal 1 products and test site.com/portal2/products as the url for portal 2. The urls are set up exactly the same as this for all of the other content and views.

I also realize that this will get somewhat complex when dealing with users entering the site to internal links. A logic diagram has already been laid out, but that is a point of concern as well.

  • 写回答

1条回答 默认 最新

  • dragon7088 2013-10-16 18:54
    关注

    Session data or cookies would be the way to go. You would want to set this when the user selects a portal. Then, you would check that the user is on the right portal by getting the current url. I'm positive there is a Drupal hook for this.

    For reading the cookie/session data there are a couple ways to do this. Firstly, you would probably need to create a module to do this. Drupal has rules and hooks so that you could run your portal routing code only on specific pages. The other option is to run that code on every page load, but that is not recommended by Drupal and it's followers.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 妆容迁移BeautyGAN数据集
  • ¥15 不知道是该怎么引用多个函数片段
  • ¥15 pip install后修改模块路径,import失败,需要在哪里修改环境变量?
  • ¥15 爬取1-112页所有帖子的标题但是12页后要登录后才能 我使用selenium模拟登录 账号密码输入后 会报错 不知道怎么弄了
  • ¥30 关于用python写支付宝扫码付异步通知收不到的问题
  • ¥50 vue组件中无法正确接收并处理axios请求
  • ¥15 隐藏系统界面pdf的打印、下载按钮
  • ¥15 MATLAB联合adams仿真卡死如何解决(代码模型无问题)
  • ¥15 基于pso参数优化的LightGBM分类模型
  • ¥15 安装Paddleocr时报错无法解决