Guest User

Untitled

a guest
May 21st, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. {% for siteId in groupSiteIds %}
  2. {% if siteId == entry.siteId %}
  3. // currentSite = entry.siteId
  4. {% else %}
  5. // not the current site
  6. {% endif %}
  7. {% endif %}
  8.  
  9. $event->rules[] = [
  10. 'pattern' => 'form-builder/elements/<action:>/<id:d+>/<siteHandle:w+>',
  11. 'route' => 'form-builder/element/<action>',
  12. 'defaults' => [
  13. 'id' => null,
  14. 'siteHandle' => Craft::$app->getSites()->getPrimarySite()->handle,
  15. 'action' => 'index'
  16. ]
  17. ];
  18.  
  19. public function actionEditEntry(string $sectionHandle, int $entryId = null, int $draftId = null, int $versionId = null, string $siteHandle = null, Entry $entry = null): Response
  20. if ($siteHandle !== null) {
  21. $variables['site'] = Craft::$app->getSites()->getSiteByHandle($siteHandle);
  22.  
  23. if (!$variables['site']) {
  24. throw new NotFoundHttpException('Invalid site handle: '.$siteHandle);
  25. }
  26. }
Add Comment
Please, Sign In to add comment